Filters

Descriptions

widget_title


This filter allows to modify title of widgets.

add_filter( 'widget_title', 'rtm_widget_title', 10, 1 );

function rtm_widget_title( $title ) {
    return 'rtMedia : '. $title;
}

This filter is use to modify title of tab in gallery widget.

add_filter( 'rtm_gallery_widget_media_type_title', 'rtmedia_gallery_widget_media_type_title', 10, 3);

function rtmedia_gallery_widget_media_type_title(  $strings, $type, $wdType  ) {
    if ( 'photo' == $type ){
        $strings = 'Images';
    }
    return $strings;
}

rtmedia_allow_uploader_view


This filter is use to restrict uploader view from rendering.

add_filter( 'rtmedia_allow_uploader_view', 'rtm_allow_uploader_view', 10, 2 );

function rtm_allow_uploader_view ( $flag, $uploader ){
    if ( 'uploader_widget' == $uploader ) {
        $flag = false;
    }
    return $flag;
}

rtmedia_upload_not_allowed_message


This filter is use to modify ‘Upload media not allowed‘ warning message.

add_filter( 'rtmedia_upload_not_allowed_message', 'rtm_uploader_not_allowed_message', 10, 2);

function rtm_uploader_not_allowed_message( $msg, $uploader ) {
    if ( 'uploader_widget' == $uploader ) {
        $msg = 'You are not allowed to upload media from this widget.'; 
    }
    return $msg;
}

rtmedia_widget_show_public_media_only


By default gallery widget will only show media with public privacy. Use this filter to modify that behaviour. Retrun either true / false as per your requirement.

add_filter( 'rtmedia_widget_show_public_media_only', 'rtmedia_widget_modify_show_public_media_only', 10, 1);

function rtmedia_widget_modify_show_public_media_only( $show ) {
    return false;
}

rtmedia_upload_tabs

This filter can be used to change the title of the select button in the rtMedia sidebad uploader.

For example:

add_filter('rtmedia_upload_tabs', 'function_to_rename_selector_button', 10, 1);
function function_to_rename_selector_button($tabs){
    $tabs['file_upload']['default']['content'] = str_replace( 'value="Select"', 'value="Select the files"', $tabs['file_upload']['default']['content']);
    return $tabs;
}