This gist has been migrated to a repo here.
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 | |
define('WYSIWYG_META_BOX_ID', 'my-editor'); | |
define('WYSIWYG_EDITOR_ID', 'myeditor'); //Important for CSS that this is different | |
define('WYSIWYG_META_KEY', 'extra-content'); | |
add_action('admin_init', 'wysiwyg_register_meta_box'); | |
function wysiwyg_register_meta_box(){ | |
add_meta_box(WYSIWYG_META_BOX_ID, __('WYSIWYG Meta Box', 'wysiwyg'), 'wysiwyg_render_meta_box', 'post'); | |
} |
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 | |
/** | |
* Customize Image Reloaded Class | |
* | |
* Extend WP_Customize_Image_Control allowing access to uploads made within | |
* the same context | |
*/ | |
class My_Customize_Image_Reloaded_Control extends WP_Customize_Image_Control { | |
/** | |
* Constructor. |
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 | |
/** | |
* Limit Primary Menu to Top Level Items | |
* | |
* @author Bill Erickson | |
* @link http://www.billerickson.net/customizing-menu-arguments/ | |
* | |
* @param array @args | |
* @return array |
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 | |
/** | |
* Default Category Title | |
* | |
* @author Bill Erickson | |
* @url http://www.billerickson.net/default-category-and-tag-titles | |
* | |
* @param string $headline | |
* @param object $term |
The ability to use PHP 4 style constructors is getting removed from PHP. Without an update, many plugins will eventually no longer work (this is PHP breaking this backwards compatibility, not WordPress)
One of the more common uses of the PHP 4 style constructor (as opposed to PHP 5 style __construct()
) are plugins with widgets calling WP_Widget::WP_Widget()
and/or parent::WP_Widget()
and/or {object}->WP_Widget()
Note: Starting in WordPress 4.3, regardless of the PHP version in use on a server, WordPress will throw a deprecated notice when one of the PHP 4 style constructors is called specifically for widgets.
Basically instead of doing these:
** Command to list all infected files:
grep -lr --include=*.php "eval(base64_decode" /path/to/webroot
grep -lr --include=*.php "eval" .
grep -lr --include=*.php "base64" .
grep -lr --include=*.php "eval(base64_decode" /path/to/webroot | xargs sed -i.bak 's/<?php eval(base64_decode[^;]*;/<?php\n/g'
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 | |
function update_myplugin() { | |
// Get current version number | |
require_once ABSPATH . 'wp-admin/includes/plugin.php'; | |
$version = get_plugin_data(WPMU_PLUGIN_DIR .'/myplugin.php'); | |
// Check if current version is latest | |
if($version['Version'] < 1.0) { | |
// Use wp_remote_get to fetch the data and store it to a file | |
$response = wp_remote_get('https://s3.amazonaws.com/path/to/zipfile/myplugin.zip', array( 'stream' => true, 'filename' => WPMU_PLUGIN_DIR . '/myplugin.zip') ); |
OlderNewer