Introduction

  Edit This Page

Filters

Description

rtmedia_allow_uploader_view


Filter to modify allow uploader view value.

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

function rtm_allow_uploader_view ( $allow, $uploader ) {
    if ( 'comment_form' == $uploader ) {
        $allow = false;
    }
    return $allow;
}

rtmedia_upload_not_allowed_message


This filter is use to modify upload not allowed warning message.

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

function rtm_upload_not_allowed_message ( $msg, $uploader ) {
    if ( 'comment_form' == $uploader ) {
        return  __( 'You are not allowed to attach media in comment.', 'rtmedia' );
    }
    return $msg;
}


Filter to modify html content for WordPress comment attachments before it get render.

add_filter('rtmedia_wordpress_comment_attachment_view_filter', 'rtm_wordpress_comment_attachment_view_filter', 10, 2 );

function rtm_wordpress_comment_attachment_view_filter ( $attachment_content, $attached_medias ) {
    return  '<div style="border: 2px dashed black;" >'. $attachment_content .'</div>';
}