Hello,
Trying to create an if statement which detects if a user on buddypress profile has media uploaded to a gallery, and if not, display a notice alert message.
Is there a template tag that detects if a user (based off his or her User ID) has media in a gallery?
Hi Brian,
Thank you.
There is a function that will allow you to do it$ids = mpp_get_gallery_ids( array( 'component'=> 'members', 'component_id'=> bp_loggedin_user_id() ) ); $total = count( $ids );
Please do note that I do not recommend multiple usage of it for counting purpose. It is not efficient for multiple usage. In upcoming release we will store the total gallery/media count in the user meta to make it faster.
Thank you
Brajesh
Viewing 4 posts - 1 through 4 (of 4 total)
The topic ‘ [Resolved] Detect if user has media in gallery?’ is closed to new replies.
This topic is: resolved