A.bp_includes 是buddypress的动作并被吸引住了plugins_loaded
function remove_bp_docs() {
global $wpdb;
$current_user = get_current_user_id();
//We are selecting member type before buddypress load so bp_get_member_type won\'t work neither wp_get_object_terms
$query = "SELECT t.slug FROM {$wpdb->terms} AS t INNER JOIN {$wpdb->term_taxonomy} AS tt ON tt.term_id = t.term_id INNER JOIN {$wpdb->term_relationships} AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy = \'bp_member_type\' AND tr.object_id = $current_user";
$member_type = $wpdb->get_var( $query );
if ( ! empty($member_type ) && \'client\' == $member_type ) {
remove_action( \'bp_include\', \'bp_docs_init\' );
}
}
add_action( \'bp_include\', \'remove_bp_docs\', 9 );