This topic has 1 reply, 2 voices, and was last updated 9 years by sharmstr.

  • Author
  • #93584
     danio987
    Participant

    Hello,

    I have little problem because i want to display users by certain role type. And I want this to be automatic, in K elements there are few widgets such as Buddypress Members Carousel, and there are few users type such as:

    Active
    Newest
    Popular
    Online
    Alphabetical
    Random

    I would like to extend this to actual roles on site, like Administrator, Keymaster, Suscriber and so on…

    The code used in plugin-js-composer/config.php looks like this:

    array(
    “type” => “dropdown”,
    “holder” => “div”,
    “class” => “”,
    “heading” => __(“Type”),
    “param_name” => “type”,
    “value” => array(
    ‘Active’ => ‘active’,
    ‘Newest’ => ‘newest’,
    ‘Popular’ => ‘popular’,
    ‘Online’ => ‘online’,
    ‘Alphabetical’ => ‘alphabetical’,
    ‘Keymaser’ => ‘Keymaster’,
    ‘Random’ => ‘random’
    ),
    “description” => __(“The type of members to display.”)
    ),

    Are there any other ways to put users like Admins in carousel?

    Reggards

    #93634
     sharmstr
    Moderator

    If you look in /k-elements/shortcodes/templates/buddypress/kleo_bp_members_carousel.php, you’ll see that the type arguments are passed to the bp_has_members function. That function doesnt filter by WP user roles.

    Since bp_has_members does have an include parameter, you can probably edit the arguments to pass a list of your admins users ids.

    https://codex.buddypress.org/developer/loops-reference/the-members-loop/#accepted-parameters

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?