3

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.

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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