Skip to content

Instantly share code, notes, and snippets.

@gmax21
gmax21 / store-button.php
Last active August 29, 2015 14:07
Member wanted code that would add a second button to his BuddyPress install that sends the admins of each site to a frontend page. http://premium.wpmudev.org/forums/topic/button-to-redirect-users-to-the-marketpress-frontend-page-store-admin-page
function bp_get_blogs_visit_store_admin_button( $args = '' ) {
$defaults = array(
'id' => 'store_admin_blog',
'component' => 'blogs',
'must_be_logged_in' => false,
'block_self' => false,
'wrapper_class' => 'store-admin-button visit',
'link_href' => bp_get_blog_permalink() . 'store-admin',
'link_class' => 'store-admin-button visit',
'link_text' => __( 'Store Admin', 'tkb_store_button' ),
@gmax21
gmax21 / gist:771dfdacb2a083cc96e3
Created September 5, 2014 23:26
Get site mapped domain echoed - WPMU DEV Domain Mapping
function tkb_get_mapped_domain($site_id = NULL){
global $wpdb;
if ($site_id === NULL){
$site_id = get_current_blog_id();
}
$mapped_domain = $wpdb->get_var( $wpdb->prepare( "SELECT domain FROM {$wpdb->dmtable} WHERE blog_id = %d LIMIT 1", $site_id ) );
echo $mapped_domain;
}
@gmax21
gmax21 / gist:1d7764eda5e6efe78acd
Created July 22, 2014 19:14
Remove the WPMU DEV Classified Ads tab from BuddyPress profile.
add_action( 'init', 'remove_classified_nav_buddypress');
function remove_classified_nav_buddypress() {
global $Classifieds_Core;
remove_action('wp', array( $Classifieds_Core, 'add_navigation' ), 2);
}
@gmax21
gmax21 / remove-membership-notice
Last active August 29, 2015 14:04
Remove the message "You are logged in as a Membership Admin user, you will therefore see all protected content on this site." from WPMU DEV Membership plugin.
function remove_custom_admin_actions(){
global $membershipadmin;
remove_action('all_admin_notices', array($membershipadmin, 'show_membership_status_notice'));
}
add_action( 'admin_init', 'remove_custom_admin_actions', 99);