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 ??? ) ); ?>
We store a meta key to mark an item as under moderation. It is under post meta
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).
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.
You must be logged in to reply to this topic.