Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)

  • MickFrench
    Participant

    @mickfrench

    Thank you David for you help !
    It works great now !


    MickFrench
    Participant

    @mickfrench

    Thank you Michael, it works using Code Snippets with this code:
    /**
    * Exclude Users from BuddyPress Members List by WordPress role.
    *
    * @param array $args args.
    *
    * @return array
    */
    function buddydev_exclude_users_by_role( $args ) {
    // do not exclude in admin.
    if ( is_admin() && ! defined( ‘DOING_AJAX’ ) ) {
    return $args;
    }

    $excluded = isset( $args[‘exclude’] ) ? $args[‘exclude’] : array();

    if ( ! is_array( $excluded ) ) {
    $excluded = explode( ‘,’, $excluded );
    }

    $role = ‘administrator’;// change to the role to be excluded.
    $user_ids = get_users( array( ‘role’ => $role, ‘fields’ => ‘ID’ ) );

    $excluded = array_merge( $excluded, $user_ids );

    $args[‘exclude’] = $excluded;

    return $args;
    }

    add_filter( ‘bp_after_has_members_parse_args’, ‘buddydev_exclude_users_by_role’ );


    MickFrench
    Participant

    @mickfrench

    Thank you Michael,
    It doesn’t work. I have tried the second code for admnins and also the first code by excluding users by ID (numbers of the admins I want to hide).
    Tried at the root of folder Plugins and BuddyPress, also into the code directly in functions.php of my theme Sydney… nothing works.
    Hoping you or someone have another idea ?


    MickFrench
    Participant

    @mickfrench

    Thanks a lot Mathieu for your fast response

    I have found this in my search of uncaught errors:

    “Compatibility Fix: Added support for a define to disable a feature of Sync that sets the WP_ADMIN define to true when handling an authenticated request from the Sync server. This feature exists to prevent compatibility issues with some security plugins yet can also cause a conflict with some plugins. To disable this feature, add the following to the site’s wp-config.php file:
    define( ‘ITHEMES_SYNC_SKIP_SET_IS_ADMIN_TO_TRUE’, true );”

    Do you think that it will do the job looking forward a solution ?
    I mean adding into the wp-config.php file:
    define( ‘BP_SIGNUPS_SKIP_USER_CREATION’, true );
    Thank you ! et merci beaucoup 😉

    Mick


    MickFrench
    Participant

    @mickfrench

    Hello, I got the same error at same line 249 when I want to activate a pending account manually.
    This happen with
    WordPress version 6.0.1
    Active theme: Sydney
    Current plugin: BuddyPress (version 10.3.0)
    PHP version 7.4.30
    I tried with no plugin only the Sydney Theme. It happens also with precedent WP version.
    I see nothing bad except this error on an alert page.
    I have to go back and continue as admin.

    I’ve seen a topic where Mathieu Viet & David Cavins are working on it last 8 month.
    /bp-members/bp-members-membership-requests.php:249
    May be they can take a look ?
    Thank you

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