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
s/\$\([a-z_]\{2,\}\)/$r['\1']/gc |
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 | |
// Bail if WP-CLI is not present. | |
if ( !defined( 'WP_CLI' ) ) return; | |
class BBG_Command extends WP_CLI_Command { | |
public function generate_shared_terms( $args, $assoc_args ) { | |
global $wpdb; |
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 | |
/** | |
* Change a site's domain. | |
* | |
* ## OPTIONS | |
* | |
* --from=<from> | |
* : The current domain of the site being changed. | |
* | |
* --to=<date> |
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 | |
// Use: $ wp eval-file fix-changed-plugin-filename.php | |
global $wpdb; | |
$blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" ); | |
$p = 'list-category-posts/list_cat_posts.php'; | |
$new_p = 'list-category-posts/list-category-posts.php'; | |
foreach ( $blog_ids as $blog_id ) { |
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 | |
/** | |
* Does the grunt work | |
*/ | |
function bbg_test_groupblog_idea2() { | |
global $wpdb, $bp, $current_blog; | |
// Never do this on the root blog | |
if ( bp_is_root_blog() ) |
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 | |
/** | |
* Updates Woo Framework in all WooThemes on a WP installation | |
* | |
* To use: | |
* | |
* - Get the latest copy of the framework | |
* - Unzip to /wp-content/framework/ | |
* - Visit wp-admin?cac_update_woo=1 as super admin |
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
#!/bin/bash | |
# cd into the directory | |
cd ~/gitsync/github-wordpress-sync/; | |
# Make sure we are not already running | |
if [ -f .sync-running ];then | |
if test ! `find ".sync-running" -mmin +10`;then | |
# Currently running, but not stuck | |
exit 1; | |
fi | |
fi; |
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 | |
/** | |
* Turn email-style quotes into blockquotes | |
* | |
* For example: | |
* | |
* My friend said: | |
* | |
* > You are handsome and also |
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 | |
/** | |
* Recommended usage: Don't use this at all. Setting widgets programatically is generally a bad idea. | |
* Let your users do it - that's what the UI is for. | |
* | |
* However, if you must use it: | |
* BBG_Widget_Setter::clear_sidebar( 'sidebar-1' ); | |
* to clear the widgets from the sidebar called 'sidebar-1' (they are moved to | |
* "Inactive Widgets".) And: |
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 | |
/** | |
* Are we looking at the WordPress admin? | |
* | |
* Because AJAX requests are sent to wp-admin/admin-ajax.php, WordPress's | |
* is_admin() function returns true when DOING_AJAX. This function contains | |
* logic to test whether AJAX requests are coming from the front end or from | |
* the Dashboard. | |
* | |
* @return bool |
OlderNewer