Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've managed to add a custom tab to the media uploader, but for some reason it doesn't come with the same layout - it doesn't load the media-uploader-header that contain all the other tabs:

  add_filter('media_upload_tabs', 'my_media_upload_tabs_filter');

function my_media_upload_tabs_filter($tabs) {
        unset($tabs["type_url"]);
        unset($tabs['library']);
        $newtab = array('ell_insert_gmap_tab' => __('Google Map','insertgmap'));

        return array_merge($tabs,$newtab);
}

add_action('media_upload_ell_insert_gmap_tab', 'media_upload_ell_gmap_tab');

function media_upload_ell_gmap_tab() {
    return wp_iframe('media_upload_ell_gmap_form', $errors );
}

function media_upload_ell_gmap_form() {
    ?>
    <h2>HTML Form</h2>

<?php
}  

Thanks.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

found it. in the automattic SVN for media.php i found the media_upload_header() function, and the only thing left to do is to echo it in the last function:

function media_upload_ell_gmap_form() {
    echo media_upload_header();
    ?>
    <h2>HTML Form</h2>

<?php
}

that's it.

share|improve this answer
    
and this also works. –  Asaf Chertkoff Mar 9 '11 at 12:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.