- rtmedia_allow_uploader_view
- rtmedia_comment_media_size
- rtmedia_render_wp_comment_attachment_uploader
- rtmedia_upload_not_allowed_message
- rtmedia_wordpress_comment_attachment_view_filter
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_comment_media_size
Filter to modify images size in wordpress comment.
if ( ! function_exists( 'rtmedia_comment_media_size_callback' ) ) {
function rtmedia_comment_media_size_callback( $size_key ) {
$size_key = 'rt_media_thumbnail';
return $size_key;
}
}
add_filter( 'rtmedia_comment_media_size', 'rtmedia_comment_media_size_callback', 10, 1 );
rtmedia_render_wp_comment_attachment_uploader
Filter to allow or disallow uploader in WordPress Comment section
if ( ! function_exists( 'rtmedia_render_wp_comment_attachment_uploader_callback' ) ) {
function rtmedia_render_wp_comment_attachment_uploader_callback( $value ) {
return false;
}
}
add_filter( 'rtmedia_render_wp_comment_attachment_uploader', 'rtmedia_render_wp_comment_attachment_uploader_callback', 10, 1 );
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;
}
rtmedia_wordpress_comment_attachment_view_filter
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>';
}