public
Last active

Buddypress - Remove "All members" on Members directory ( javascript trick )

  • Download Gist
remove_all_members_tab.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13
//add this code to functions.php
 
function bp_remove_allmembers_tab_js_script(){ ?>
<script type="text/javascript">
var jq = jQuery;
jQuery(document).ready(function (jQuery) {
jq('#members-all').removeClass('selected').hide();
jq('#members-personal').find('a').trigger('click');
});
</script>
<?php }
add_action('wp_footer', 'bp_remove_allmembers_tab_js_script');

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.