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: Time Shortcode | |
* Author: Otto | |
* | |
* Usage: [time]any-valid-time-string-here[/time] | |
* Will attempt to parse the time string and create a format that shows it in the viewers local time zone | |
* Note that times should be complete with year, month, day, and hour and minute.. something strtotime can parse meaningfully | |
* Conversion happens via Javascript and will depend on the users browser. | |
**/ |
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
add_action( 'init', 'disable_emoji', 1 ); | |
function disable_emoji() { | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); | |
remove_action( 'wp_print_styles', 'print_emoji_styles' ); | |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); | |
remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); | |
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); | |
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); | |
add_filter( 'tiny_mce_plugins', 'disable_tinymce_emoji' ); |
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: Testing | |
*/ | |
class Demo { | |
function do_a_thing() { | |
echo '<!-- demo -->'; | |
} | |
} |
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: Allow Private Parents | |
Author: Otto | |
Author URI: http://ottopress.com | |
*/ | |
add_filter('page_attributes_dropdown_pages_args', 'allow_private_page_parents'); | |
function allow_private_page_parents($args) { | |
$args['post_status'] = array( 'publish', 'private' ); |
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 | |
// Decodes files that have a bunch of strings with things like "\x6d" and "\155" and such in them. | |
// Meat of the code from https://stackoverflow.com/questions/13774215/convert-hex-code-into-readable-string-in-php | |
// run me like so on command line: | |
// php decode.php < encoded.php > output.php | |
function decode_code($code) | |
{ | |
return preg_replace_callback('@\\\(x)?([0-9a-f]{2,3})@', | |
function ($m) { | |
if ($m[1]) { |
OlderNewer