Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: [Resolved] Hiding Members Page to everybody (visitor and also members)

@ico33

Participant

@sbrajesh

Hello and thanks for the support, I tried the solution suggested, but after I created and then uploaded the file bp-custom in the plugins folder I got an error in every page of the website:

Parse error: syntax error, unexpected ‘function’ (T_FUNCTION) in /home/mondolap/public_html/wp-content/plugins/bp-custom.php on line 2

This is my file bp-custom:

<? php
function buddydev_hide_members_directory_from_all_except_admin() {

    if ( bp_is_members_directory() && ! is_super_admin() ) {
        //should we add a message too?
        //bp_core_add_message( 'Private page.', 'error' );
        bp_core_redirect( site_url('/') );
    }
}
add_action( 'bp_template_redirect', 'buddydev_hide_members_directory_from_all_except_admin' );
?>
Skip to toolbar