rtmedia_privacy_levels Filter


#1
/* Custom rtMedia Privacy Levels */
add_filter( 'rtmedia_privacy_levels', 'custom_rtmedia_privacy_levels' );
function custom_rtmedia_privacy_levels() {
    $custom = array(
        'levels' => array(
            20 => '<strong>Logged in Users</strong> - Visible to registered users',
            0 => '<strong>Public</strong> - Visible to the world',
            )
        );
  return $custom;
}

The goal of this is to remove “Friends” and “Private”. I cant seem to find my error. Any ideas?


#2

Hi @illusionsglass,

Your code won’ t work because you are returning values without accepting one in filter. You should at least pass one parameter to filter.

So it should be like following:

add_filter( 'rtmedia_privacy_levels', 'custom_rtmedia_privacy_levels', 10, 1 );

function custom_rtmedia_privacy_levels( $custom ) {
         // your code here
	return $custom;
}

#3

What level is friend at? I see that “logged in users” is 20


#4

Hi @Jonas_Bogvad,

Friend is at level 40.

Thank you.


#5