- rtm_allow_custom_thumbnail
- rtmedia_view_media_attributes
- rtmedia_allow_add_attribute_render
- rtmedia_edit_media_attribute_select
Descriptions
rtm_allow_custom_thumbnail
The filter is used to restrict set custom thumbnail for any media type.
Note:: Here media type for album is album-edit.
add_filter( 'rtm_allow_custom_thumbnail', 'rtmedia_allow_custom_thumbnail', 10, 2 );
function rtmedia_allow_custom_thumbnail( $allow, $media_type ) {
if ( 'video' == $media_type ) {
$allow = false;
}
return $allow;
}
rtmedia_view_media_attributes
and
rtmedia_allow_add_attribute_render
If the website owner wants to hide the media attributes from the users of his website but still want them to create and manage at the backend then he can use below filters.
After adding below code the custom attributes won’t appear at the time of media upload.
add_filter( 'rtmedia_view_media_attributes', 'rtmedia_hide_media_attributes_from_frountend_callback', 100 );
add_filter( 'rtmedia_allow_add_attribute_render', 'rtmedia_hide_media_attributes_from_frountend_callback', 100 );
function rtmedia_hide_media_attributes_from_frountend_callback( $value ){
return false;
}
rtmedia_edit_media_attribute_select
If the website owner wants to disable the rendering of the media attributes in theĀ edit form for single media in ‘Edit single media’ page, then it can be achieved using this filter.
Usage:
add_filter( 'rtmedia_edit_media_attribute_select', 'rtmedia_disable_render_attribute_edit', 100 );
function rtmedia_disable_render_attribute_edit( $value ){
$value = false;
return $value;
}