BuddyDev

Search

[Resolved] Mediapress Media moderation – get photo status in moderation

Tagged: ,

  • Participant
    Level: Initiated
    Posts: 6
    Jan Vasek on #27438

    Hi there,

    i would like to get status of photo which is in the moderation. It is possible? Is there unique status for photos they are in moderation?

    I have a problem, when I show to user count of his photos. Counter calculate photos in moderation… I would like don’t count photos in moderation.

    My code is

     
    <?php 
     $total_uploaded_photo = mpp_get_media_count(array( 
        'component_id' => bp_displayed_user_id(), 
        'component' => 'members', 
        'type' => 'photo',
        'status' => 'public'
        // don't count photos in moderation ???
    ) );
    ?>
     
  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #27452

    Hi Jan,
    We store a meta key to mark an item as under moderation. It is under post meta

    
    _mpp_in_moderation
    

    The mpp_get_media_count is not capable of handling meta key.

    We need a query that is similar to mpp_get_media_count but excludes these posts. I may be able to write something on Tuesday(Or modify MediaPress API to make it simpler).

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 6
    Jan Vasek on #27453

    thanks, I would really appreciate it

  • Participant
    Level: Initiated
    Posts: 6
    Jan Vasek on #27622

    Some news? 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #27634

    Hi Jan,
    I have updated the plugin code today to accept any args available for Meta Query.

    You can count now with

    
    
    	$total_uploaded_photo = mpp_get_media_count( array(
    		'component_id' => bp_displayed_user_id(),
    		'component'    => 'members',
    		'type'         => 'photo',
    		'status'       => 'public',
    		'meta_query'   => array(
    			'relation' => 'AND',
    			array(
    				'key'     => '_mpp_in_moderation',
    				'value'   => 1,
    				'compare' => 'NOT EXISTS'
    			)
    		)
    	) );
    
    

    It is only available in our development repor currently(will be available in with next release).
    Here is the change I made.
    https://github.com/buddydev/mediapress/commit/56924852f34da86bfcb3a4536f404ddecd44390c

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 6
    Jan Vasek on #27724

    Thank you! Great!

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #27736

    You are welcome.

You must be logged in to reply to this topic.

This topic is: resolved