This is a list of the SublimeText 2 addons I use for my development environment.
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 | |
| /* | |
| * Background Caching with Transients | |
| * Using BBC News API as an example | |
| */ | |
| function pb_get_news() { | |
| /* | |
| * Get transient and if expired refresh data immediately |
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: Heartbeat Comment Update | |
| Description: Updates Comment Count on Dashboard with Heartbeat. | |
| Author: Andrew Ozz, Mike Schroder | |
| Version: 0.2 | |
| Author URI: http://www.getsource.net | |
| */ | |
| add_filter( 'heartbeat_received', 'wc_heartbeat_comment_count', 10, 3 ); |
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
| #!/bin/sh | |
| dbname=wpsample | |
| dbuser=root | |
| dbhost=127.0.0.1 | |
| dbpass=password | |
| wphost=localhost | |
| wptitle="wp-cli sample site." | |
| wpadmin_name="dontadmin" | |
| wpadmin_email="[email protected]" |
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
| DELETE FROM wp_usermeta | |
| WHERE NOT EXISTS ( | |
| SELECT * FROM wp_users | |
| WHERE wp_usermeta.user_id = wp_users.ID | |
| ) |
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 | |
| class custom_feed { | |
| public $feed = 'custom-xml'; | |
| public function __construct() { | |
| add_action( 'init', array( $this, 'init' ) ); | |
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
| add_action( 'init', 'jf_register_my_new_sitemap', 99 ); | |
| /** | |
| * On init, run the function that will register our new sitemap as well | |
| * as the function that will be used to generate the XML. This creates an | |
| * action that we can hook into built around the new | |
| * sitemap name - 'wp_seo_do_sitemap_my_new_sitemap' | |
| */ | |
| function jf_register_my_new_sitemap() { | |
| global $wpseo_sitemaps; | |
| $wpseo_sitemaps->register_sitemap( 'my_new_sitemap', 'jf_generate_my_new_sitemap' ); |
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
| #!/bin/bash | |
| find $1 \( -type f -and \( -name "*.php" -or -name "*.inc" -or -name "*.phtml" \) \) -exec php -l {} \; | grep -v "No syntax errors" |
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 all evidence of WP Engine from the Dashboard, unless the logged in user is "wpengine" | |
| $user = wp_get_current_user(); | |
| if ( $user->user_login != 'wpengine' ) { | |
| add_action( 'admin_init', 'jpry_remove_menu_pages' ); | |
| add_action( 'admin_bar_menu', 'jpry_remove_admin_bar_links', 999 ); | |
| } | |
| /** |
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 indexed($url) { | |
| $url = 'http://webcache.googleusercontent.com/search?q=cache:' . urlencode($url); | |
| $ch = curl_init($url); | |
| curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); | |
| curl_setopt($ch, CURLOPT_NOBODY, true); | |
| curl_setopt($ch, CURLOPT_USERAGENT, 'Chrome 10'); | |