BuddyDev

Search

Display user Media

Tagged: 

  • Participant
    Level: Initiated
    Posts: 9
    Tomasz Sztreker on #4078

    Hi ,
    I would like display last added photo of displayed user next to profile picture.
    My question is:
    Do I can do this via shortcode or I nave write custom loop I tried use this loop from the example : ( https://buddydev.com/mediapress/topics/api-reference/core/mpp_media_query/ ) and function “bp_displayed_user_id”
    bud don’t work for my

    // The Query
    $user_id = bp_get_member_user_id();
    $the_media_query = new MPP_Media_Query( ‘author=’ . $user_id );

  • Participant
    Level: Initiated
    Posts: 9
    Tomasz Sztreker on #4080

    Ok it working, I used code below , i hope it is correct solution.

    global $bp;
    $user = $bp->displayed_user->id;
    $args = array(
    ‘user_id’ => $user,
    );

    // The Query
    $the_media_query = new MPP_Media_Query( $args );

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

    Hi Tomasz,

    I am glad that problem is resolved. But if I were you the code will be something like this

    
    $the_media_query = new MPP_Media_Query( array('user_id' => bp_displayed_user_id() ) );
    
    

    Thank You
    Ravi

You must be logged in to reply to this topic.

This topic is: not resolved