BuddyDev

Search

Replies

  • Participant
    Level: Initiated
    Posts: 13
    George Plumley on #20741

    I never have figured out why the plugin’s shortcode isn’t working.

    However, because I like your interface for Setting and Removing featured status for members, I wrote my own shortcode.

    I’m putting it in here in case it’s helpful to anyone else:

    
    function display_featured_members() {
    
    $return_string = '<ul class="featured-members">';
    $args = array( 'meta_key' => '_is_featured', 'orderby' => 'display_name',  'order' => 'ASC' );
    // The Query
    $user_query = new WP_User_Query( $args );
    // User Loop
    if ( ! empty( $user_query->get_results() ) ) {
    	foreach ( $user_query->get_results() as $user ) {
    		$key = '_is_featured';
    		$featured_state = get_user_meta( $user->ID, $key, true );
    		if ( $featured_state == '1' ) {
    			$return_string .= '<li>' . $user->display_name . '</li>';
    		}
    
    	}
    } else {
    	$return_string .= 'No users found.';
    }
    
    $return_string .= '<ul>';
     return $return_string;
    
    }
    
    function bmm_shortcodes_init()
    {
        add_shortcode('bmm-featured-members', 'display_featured_members');
    }
     
    add_action('init', 'bmm_shortcodes_init');
    
  • Participant
    Level: Initiated
    Posts: 13
    George Plumley on #20498

    And this was in the Caller column for that query

    the_content()
    wp-includes/post-template.php:240
    apply_filters(‘the_content’)
    wp-includes/plugin.php:203
    do_shortcode()
    wp-includes/shortcodes.php:197
    preg_replace_callback()
    wp-includes/shortcodes.php:319
    do_shortcode_tag()
    wp-includes/shortcodes.php:319
    bp_featured_members_shortcode()
    wp-content/plugins/bp-featured-members/core/bp-featured-members-shortcode.php:61
    bp_fm_load_members_list()
    wp-content/plugins/bp-featured-members/core/bp-featured-members-functions.php:68
    bp_has_members()
    wp-content/plugins/buddypress/bp-members/bp-members-template.php:415
    BP_Core_Members_Template->__construct()
    wp-content/plugins/buddypress/bp-members/classes/class-bp-core-members-template.php:144
    bp_core_get_users()
    wp-content/plugins/buddypress/bp-members/bp-members-functions.php:142
    BP_User_Query->__construct()
    wp-content/plugins/buddypress/bp-core/classes/class-bp-user-query.php:191
    BP_User_Query->prepare_user_ids_query()
    wp-content/plugins/buddypress/bp-core/classes/class-bp-user-query.php:455

  • Participant
    Level: Initiated
    Posts: 13
    George Plumley on #20497

    Put in Query Monitor and this was the only obvious item on the page where I’m running the shortcode

    SELECT user_id
    FROM wp_usermeta
    WHERE meta_key = ‘_is_featured’
    AND meta_value = ‘1’

  • Participant
    Level: Initiated
    Posts: 13
    George Plumley on #20490

    I tried switching from the Nouveau template to the Legacy template, but no results.

    And these are the BuddyPress Components that I have running

    Extended Profiles
    Account Settings
    Notifications
    BuddyPress Core
    Community Members

  • Participant
    Level: Initiated
    Posts: 13
    George Plumley on #20489

    I’ve also gone through and updated some plugins that needed it – including MemberPress – but still nothing.

    And I’ve also run the shortcode on a page that does not use WP Bakery, without result.

    I’ve tried setting Featured members through their individual profiles rather than through the member listing page – but neither action makes them appear.

    I’ve tried putting a BP Featured widget in the footer – still no members showing.

  • Participant
    Level: Initiated
    Posts: 13
    George Plumley on #20488

    I had been using that exact shortcode, but without the quote marks. Added the quote marks, and still no members shown.

    I’ve gone through again and disabled all plugins (except BP and BP Featured), as well as changing to a default WP theme – still no featured members.

  • Participant
    Level: Initiated
    Posts: 13
    George Plumley on #20460

    Sorry for the delay. Strange thing happened the other day – I could see one of the Featured Members by use of the shortcode. But the other 5 weren’t there. Tried setting shortcode to show max 100, but still one one showed. I tried unsetting everyone and then setting a new featured member – again, getting the No Members Found.

    I was thinking about the query, and I have customized member-loop.php… but only to change the number of members shown at a time and to add some new profile fields into each listing.

    GP

  • Participant
    Level: Initiated
    Posts: 13
    George Plumley on #20228

    I actually just had a chance to deactivate the MemberPress add-on, and it’s still not working.

    Overnight I’ll try deactivating all plugins -but I can’t imagine what would be filtering a BP User or WP User Query, other than these plugins.

  • Participant
    Level: Initiated
    Posts: 13
    George Plumley on #20219

    I’ve deactivated BP Profile Search and that did not fix the issue

    I’m going to have to wait until overnight to deactivate the MemberPress add-on, because that’s being used at the moment by others.

  • Participant
    Level: Initiated
    Posts: 13
    George Plumley on #20217

    Additional plugins that might be relevant

    BP Profile Search

    MemberPress + BuddyPress Integration