Skip to content

Instantly share code, notes, and snippets.

View Ritesh-patel's full-sized avatar

Ritesh Patel Ritesh-patel

View GitHub Profile
@Ritesh-patel
Ritesh-patel / php-block.js
Created September 16, 2018 06:37 — forked from pento/php-block.js
Converting a shortcode to a block
// License: GPLv2+
var el = wp.element.createElement,
registerBlockType = wp.blocks.registerBlockType,
ServerSideRender = wp.components.ServerSideRender,
TextControl = wp.components.TextControl,
InspectorControls = wp.editor.InspectorControls;
/*
* Here's where we register the block in JavaScript.
@Ritesh-patel
Ritesh-patel / hook.php
Last active August 29, 2015 14:18 — forked from desaiuditd/hook.php
<?php
// array - repo names and local filesystem path and branch
$repos = array(
'plugin-slug' => array (
'branch' => 'master',
'localpath' => '/var/www/example.com/htdocs/wp-content/plugins/plugin-slug'
),
);
hook_write_log( 'Hello at ' . date( 'D M j G:i:s T Y' ) );
<?php
// array - repo names and local filesystem path and branch
$repos = array(
'bad-plugin' => array (
'branch' => 'master',
'localpath' => '/var/www/example.com/htdocs/wp-content/plugins/bad-plugin'
)
);
rt_write_log("Hello at " . date("D M j G:i:s T Y") );