This file contains hidden or 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: EDD Readme Parsing Enhancements | |
| Description: Updates a Download's current version and change log fields when using the readme.txt parsing feature in Easy Digital Downloads. | |
| */ | |
| /** | |
| * Filters the EDD readme.txt parser response and updates the | |
| * download's current version and change log fields. | |
| */ |
This file contains hidden or 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 | |
| /* | |
| Usage: | |
| $frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL | |
| if ( !$frag->output() ) { // NOTE, testing for a return of false | |
| functions_that_do_stuff_live(); | |
| these_should_echo(); | |
| // IMPORTANT | |
| $frag->store(); | |
| // YOU CANNOT FORGET THIS. If you do, the site will break. |
This file contains hidden or 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 ttf_get_make_stats() { | |
| // Make remote request to WP.org | |
| $response = wp_remote_post( | |
| 'http://api.wordpress.org/themes/info/1.0/', | |
| array( | |
| 'body' => array( | |
| 'action' => 'theme_information', | |
| 'request' => serialize( (object) array( |
This file contains hidden or 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 | |
| /** | |
| * Integrate Imager.js with WordPress | |
| * | |
| * Imager.js is BBC's solution for serving responsive and retina images, without | |
| * the double payload issues that affect other solutions. For more information: | |
| * | |
| * https://github.com/BBC-News/Imager.js/ | |
| * | |
| * This collection of functions modifies the output of WordPress's |
This file contains hidden or 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
| function random_lipsum($amount = 1, $what = 'paras') { | |
| $start = rand(0,30); | |
| return simplexml_load_file("http://www.lipsum.com/feed/xml?amount=$amount&what=$what&start=$start")->lipsum; | |
| } |
This file contains hidden or 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 | |
| /* | |
| Usage: | |
| $frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL | |
| if ( !$frag->output() ) { // NOTE, testing for a return of false | |
| functions_that_do_stuff_live(); | |
| these_should_echo(); | |
| // IMPORTANT | |
| $frag->store(); | |
| // YOU CANNOT FORGET THIS. If you do, the site will break. |
This file contains hidden or 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 jp_modify_remote_license_check_response( $results, $args, $license_id ) { | |
| // Do things here | |
| // Set array values here | |
| $extra = array( | |
| 'your_data' => 'value', | |
| 'more_data' => 'value', | |
| ); | |
| return array_merge( $results, $extra ); |
This file contains hidden or 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
| function jp_sort_download_archives( $query ) { | |
| if ( is_tax( array( 'download_category', 'download_tag' ) ) && $query->is_main_query() ): | |
| $query->set( 'orderby', 'title' ); | |
| $query->set( 'order', 'ASC' ); | |
| endif; | |
| } | |
| add_action( 'pre_get_posts', 'jp_sort_download_archives' ); |
This file contains hidden or 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: Updates Transient Flusher | |
| Description: Deletes the update_themes and update_plugins transients. Forces WordPress to check for plugin and theme updates on every page load. FOR TESTING ONLY. | |
| */ | |
| function jp_delete_update_transients() { | |
| delete_transient( 'update_themes' ); | |
| delete_transient( 'update_plugins' ); |
This file contains hidden or 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 | |
| /** | |
| * Remove the Marketify edd_login redirect | |
| */ | |
| function jp_fix_marketify_edd_shortcode() { | |
| remove_filter( 'shortcode_atts_edd_login', 'marketify_shortcode_atts_edd_login' ); | |
| } | |
| add_action( 'init', 'jp_fix_marketify_edd_shortcode' ); |