This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WP-CLI command to delete featured images of given post type's posts. | |
* | |
* Note: First do dry-run, verify log and then do actual run. | |
*/ | |
if ( ! defined('WP_CLI') || ! WP_CLI ) { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Export Stream Records | |
* Description: Export stream records on daily basis and send email with CSV file. | |
* Author: Chandra Patel | |
*/ | |
/** | |
* Schedule daily event to perform export. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Post Meta Viewer | |
* Description: Allows to view the post meta. | |
*/ | |
/** | |
* Add Post Meta Viewer submenu under Tools menu. | |
* | |
* @return void |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WP-CLI command to delete all the thumbnails. | |
* | |
* Note: First do dry-run, verify log and then do actual run. | |
* | |
* @package delete-thumbnails | |
*/ | |
if ( defined( 'WP_CLI') && WP_CLI ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Post Meta Revisions | |
Description: Revisions for the 'foo' post meta field | |
Version: 1.0 | |
Author: John Blackbourn | |
Plugin URI: http://lud.icro.us/post-meta-revisions-wordpress | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data_dir = 'c:/server/www/dev/data/'; | |
$releases = [ ]; | |
foreach ( range( 3.2, 4.0, 0.1 ) as $version ) { | |
$version = number_format( $version, 1 ); | |
$data = json_decode( file_get_contents( $data_dir . $version . '.json' ), true ); | |
$groups = wp_list_pluck( $data['groups'], 'data' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: APC Object Cache | |
* Description: An object cache implementation that uses APC. | |
* Author: Christopher Davis | |
* Author URI: http://christopherdavis.me | |
* Version: 0.1 | |
* | |
* Based on Mark Jaquith's APC object cache | |
* http://txfx.net/wordpress-plugins/apc/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-Type: text/html; charset=utf-8'); | |
mb_internal_encoding('utf-8'); | |
function wordWrapAnnotation(&$image, &$draw, $text, $maxWidth) | |
{ | |
// separate the text by chinese characters or words or spaces | |
preg_match_all('/([\w]+)|(.)/u', $text, $matches); | |
// $words is array of Chinese characters, English Words or spaces |