BuddyDev

Search

[Resolved] mpp-list-media status=friends returns everything

  • Participant
    Level: Master
    Posts: 279
    Richard Foley on #12980

    I’m using the following shortcode:

    [mpp-list-media type="photo" component="members" status="friends" orderby=date per_page=12 pagination=1]

    As per the docs. https://buddydev.com/mediapress/topics/getting-started/shortcodes/mpp-list-media/ status=”friends” should return only photos from MY friends. I think? However, I seem to get returned a page (query result) of photos from almost all site members.

    Or have I misunderstood the shortcode?

    R.

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #12984

    Hello Richard,

    Sorry for the inconvenience. Please replace

    
    status="friends" 
    

    to

    
    status="friendsonly"
    

    And let me know if it works or not

    Thank You
    Ravi

  • Participant
    Level: Master
    Posts: 279
    Richard Foley on #12987

    Ok, thanks Ravi, this now returns media with the SETTING of visibility=friendsonly. This has nothing whatsoever to do with MY friends.

    Even though it’s weird, at least it’s understandable, (closing).

    • This reply was modified 6 years, 10 months ago by Richard Foley.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #12990

    Hello Richard,

    Thank you for the acknowledgement. Please download the latest code of MediaPress from the following url

    https://github.com/buddydev/mediapress

    and use the following code if you want to list media of loggeded-in user friends

    
    function buddydev_list_friends_media( $args ) {
    
    	if ( empty( $args['include_users'] ) && is_user_logged_in() ) {
    		$args['include_users'] = bp_get_friend_ids( bp_loggedin_user_id() );
    	}
    	return $args;
    }
    add_filter( 'mpp_shortcode_list_media_defaults', 'buddydev_list_friends_media' );
    
    

    Thank You
    Ravi

    • This reply was modified 6 years, 10 months ago by Ravi.
  • Participant
    Level: Master
    Posts: 279
    Richard Foley on #12992

    hi Ravi,

    that’s working fine, thanks very much for the quick fix!

    Cheers

    R.

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #12993

    Hello Richard,

    Thank you for the acknowledgement. I am glad that I could help.

    Regards
    Ravi

The topic ‘ [Resolved] mpp-list-media status=friends returns everything’ is closed to new replies.

This topic is: resolved