Home / Forums / DynamiX Support / Adding a swf tab to the media maager

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts

  • Gareth Jones
    Participant

    You can add a new tab to the media manager by modifying your functions.php

    The code below adds both pdf and swf mime types:

    < ?php
    /* google modify_post_mime_types */
    add_filter(‘post_mime_types’, ‘modify_post_mime_types’);
    function modify_post_mime_types($post_mime_types) {
    $post_mime_types = array(__(‘PDF’), __(‘Manage PDF’), _n_noop(‘PDF (%s)‘, ‘PDF (%s)‘));
    $post_mime_types = array(__(‘Flash’), __(‘Manage Flash’), _n_noop(‘Flash (%s)‘, ‘Flash (%s)‘));
    return $post_mime_types;
    }

    /* Modifying Allowed Upload Types in WordPress http://codex.wordpress.org/Plugin_API/Filter_Reference/upload_mimes */
    add_filter(‘upload_mimes’, ‘custom_upload_mimes’);

    function custom_upload_mimes ( $existing_mimes=array() ) {

    // add your ext => mime to the array
    $existing_mimes = ‘mime/type’;

    // add as many as you like

    // and return the new full result
    return $existing_mimes;

    }
    ?>

    Make sure you don’t leave any spaces in the file after the last ?>, otherwise you’ll ind your admin pages just go blank! Well documented on wordpress.org


    Anonymous

    Good post, thanks!


    Gareth Jones
    Participant

    I didn’t get notified that there was a reply to my post – I think I should have done…


    Anonymous

    What about now?


    Gareth Jones
    Participant

    Got that!!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.