API Docs 404

Hi! :slight_smile:

I’m trying to customize the template for single-media.php to show a video only if a user has a certain capability, and to show photos to all regardless of their assigned capabilities. Are there any conditionals to query to determine if the media requested is a photo, or a video? It looks like rtmedia_media( true ) outputs both videos and photos, so a way to determine which it is first would greatly help.

Was going to look through the docs but it appears that the links are bad on the site:

Links #2 & #3 go to pages not found

Thanks much!


Hi @illusionsglass,

You can use rtmedia_type function inside have_rtmedia() loop to get media type of current media.

Thanks for letting us know about doc links, we will check it out.

Awesome! Thanks Ritesh.

For anyone else:

if ( rtmedia_type() == video ) {
    echo "It's a video!  Put your code to restrict stuff in here....";
} else {
    echo "It's not a video!  Lets display it!";
    rtmedia_media ( true );

Hello @illusionsglass,

You are welcome !