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 | |
$categories = get_the_category(); | |
// Assemble a tree of category relationships | |
// Also re-key the category array for easier | |
// reference | |
$category_tree = array(); | |
$keyed_categories = 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 | |
/** | |
* Add an 'Other' type to xprofile fields | |
* | |
* @link https://buddypress.trac.wordpress.org/ticket/3775 | |
* @link http://redmine.gc.cuny.edu/issues/1199 | |
*/ | |
class CAC_Xprofile_Other { | |
function __construct() { | |
add_action( 'xprofile_field_additional_options', array( &$this, 'render_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
<?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
<?php | |
/** | |
* This is a quick and dirty class to work around the fact that bp_has_groups() does not have a | |
* meta_query parameter (or even an 'in' parameter). Usage: | |
* | |
* 1) Just before you fire up your bp_has_groups() loop, instantiate the BP_Groups_Meta_Filter | |
* class, with parameters $key and $value | |
* 2) Do your groups loop as normal | |
* 3) When you've closed the bp_has_groups() loop (endif;), call the method remove_filters() just |
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 |
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 qw_delete_spam_comments() { | |
$in_progress = (bool) get_site_option( 'qw_delete_in_progress' ); | |
if ( ! $in_progress ) { | |
global $wpdb; | |
update_site_option( 'qw_delete_in_progress', '1' ); | |
OlderNewer