Filters

<Descriptions

rtmedia_my_likes_media_page_title


Filter is use to modify My liked page page title.

add_filter( 'rtmedia_my_likes_media_page_title', 'rtm_my_likes_media_page_title', 10, 1 );

function rtm_my_likes_media_page_title ( $title ) {
    return 'Your likes';
}

rtmedia_user_likes_media_page_title


Filter is use to modify user’s liked page page title.

add_filter( 'rtmedia_user_likes_media_page_title', 'rtm_user_likes_media_page_title', 10, 1 );

function rtm_user_likes_media_page_title ( $title ) {
    return 'Friend likes';
}

rtmedia_query_where_filter_remove_comment_media


Filter is use to display comment media in rtMedia likes tab.


if ( ! function_exists( 'rtmedia_add_comment_media_in_media_tab' ) ) {
	/**
	 * Display comment media in rtMedia likes tab.
	 *
	 * @param boolean $value True to hide comment media False to show comment media.
	 * @param string $where Specifies where filter is being called.

	 * @return boolean True to hide comment media False to show comment media.
	 */
	function rtmedia_add_comment_media_in_media_tab( $value, $where = '' ) {
		// Check if $where equal to likes or else return the default value.
		if ( 'likes' == (string) $where  ) {
			// Return false we we want to show comment media in likes tab.
			return false;
		} else {
			return $value;
		}
	}
}
add_filter( 'rtmedia_query_where_filter_remove_comment_media', 'rtmedia_add_comment_media_in_media_tab', 10, 2 );

rtm_likes_js_strings


This filter is use to modify JS strings for rtMedia likes addon.

add_filter('rtm_likes_js_strings', 'rtmedia_likes_js_strings', 10, 1 );

function rtmedia_likes_js_strings( $rtmedia_like_main_js ) {
    $rtmedia_like_main_js ['rtmedia_media_who_liked']= 'Check who liked this media';
    return $rtmedia_like_main_js;
}

rtmedia_check_enable_disable_like


If the user does not want media like feature then this filter will help to disable it.

function rtmedia_disable_like( $enable_like ) {
    $enable_like = false;
    return $enable_like;
}
add_filter( 'rtmedia_check_enable_disable_like', 'rtmedia_disable_like', 10, 1 );