Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 5 replies - 26 through 30 (of 30 total)
  • @kwavewd

    Participant

    really appreciate you helping on this thanks again

    @kwavewd

    Participant

    Are you using part of my code from above or is this separate code where do I add this? I don’t understand what your saying about Roles?

    @kwavewd

    Participant

    I added your code to my functions.php page and all I got was a white screen?

    @kwavewd

    Participant

    I found this code but it does not work to block subscribers. No errors just doesn’t work

    function redirect_members() {
    // redirect non logged-in members
    if ( !is_user_logged_in() ) {
    // get the ID of displayed member
    $displayed_user = bp_displayed_user_id();
    if (in_array($displayed_user,get_subscriber())) {
    wp_redirect(site_url(‘/your-new-page-slug’));
    exit();
    }
    }
    }
    add_action( ‘wp’, ‘redirect_members’, 1 );

    // get all subscribers
    function get_subscribers() {
    $blogusers = get_users( ‘role=subscriber’ );
    // Array of WP_User objects.
    $exclude = array();
    foreach ( $blogusers as $user ) {
    $exclude[] .= esc_html( $user->ID );
    }
    return $exclude;
    }

    @kwavewd

    Participant

    bump I want to also block access to subscriber profiles. The admin code above blocks the admin perfectly but how do you change it to block all subscribers.

Viewing 5 replies - 26 through 30 (of 30 total)
Skip to toolbar