Is there a function to determine whether current user can view the image?


#1

Hi rtteam,

is there a function to determine whether the current user can view the image? (Related to the privacy settings of this image…)

Regards,

Sebastian


#2

Hi @Sebastian,

No, there is not any function like that.


#3

Hi @Sebastian,

If you wish, you can have function which can identify the privacy for media.

For Example, Here goes the code in your theme’s function.php file.

function test_media_privacy( $id ) {
    $rtmedia_model = new RTMediaModel();
    $media_array    = $rtmedia_model->get( array( "id" => $id ) );
    //print_r($media_array);    
}
add_action( 'init', 'test_media_privacy', 10, 1 ); 

#4