rtmedia_allowed_types


Description

Add or modify media types allowed in rtMedia.

Example 1

Adds a media type document.

function custom_rtmedia_allowed_types($allowed_types) {
    $allowed_types['document'] = array(
        'name' => 'document',
        'plural' => 'documents',
        'label' => __('Document', 'rtmedia'),
        'plural_label' => __('Documents', 'rtmedia'),
        'extn' => array('doc','pdf'),
        'thumbnail' => get_stylesheet_directory_uri().'/images/default_doc_thumb.jpg'
    );
    return $allowed_types;
}

add_filter('rtmedia_allowed_types', 'custom_rtmedia_allowed_types');

Example 2

Changes the default thumbnail for music.

function custom_rtmedia_default_music_thumb($allowed_types) {
    $allowed_types['music']['thumbnail'] = get_stylesheet_directory_uri().'/images/default_music_thumb.jpg',
    return $allowed_types;
}

add_filter('rtmedia_allowed_types', 'custom_rtmedia_default_music_thumb');

4 Comments

  1. Hi guy,
    I tried to change the default thumb for ‘photo’ but it doesn’t work for me, I have no error, but the original is still in place.
    I only replace all ‘music’ words by ‘photo’ and point the image URL to the right place.
    Tks

  2. Author

    @capobianco-bricegmail-com – Let us discuss about your issue on our support forums. Please create a topic for the same there.

  3. To any community member who might be looking to install this functionality, please be advised it is not currently working, but is scheduled for a future release.


Comments are closed on this article.
Please use free our support forum for support and discussions.

People Who Like Thisx

Loading...