WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Custom Media Upload Tab Form Question (4 posts)

  1. toneburst
    Member
    Posted 4 years ago #

    I'm trying to have my plugin create a new custom Media Upload form. I've managed to create the new tab with the code below, but I can't get the form to appear (I just get a blank page when clicking my new tab). Can anyone tell me where I'm going wrong?

    Any tips very much appreciated!

    a|x

    add_filter( 'media_upload_tabs', 'ell_gmap_upload_tab' );
    
    function ell_gmap_upload_tab( $tabs ) {
    	$newtab = array('ell_insert_gmap' => __('Google Map','insertgmap'));
    	return array_merge($tabs,$newtab);
    }
    
    /////////////////////////
    
    add_action('media_upload_ell_gmap', 'media_upload_ell_gmap');
    
    function media_upload_ell_gmap() {
    	return wp_iframe('media_upload_ell_gmap_form', $errors );
    }
    
    function media_upload_ell_gmap_form() { ?>
    	HTML Form
    <?php
    }
  2. toneburst
    Member
    Posted 4 years ago #

    OK, got it to work now.

    add_filter( 'media_upload_tabs', 'ell_gmap_upload_tab' );
    
    function ell_gmap_upload_tab( $tabs ) {
    	$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() {
    	?>
    	HTML Form
    <?php
    }

    Thanks,

    a|x

  3. asafche
    Member
    Posted 3 years ago #

    nice work.
    now - i noticed that the "media-uploader-header" doesn't show.
    why is that? did you fixed it some how?

  4. asafche
    Member
    Posted 3 years ago #

    figured it out, here.

    but now i don't know how to pass information from that tab to the window.
    i've tried to create a form that will send something, like this:

    function media_upload_choose_background_form() {
    	echo media_upload_header();
    	?>
    
    	<form enctype="multipart/form-data" method="post" action="http://www.mimi.me/wp-admin/media-upload.php?type=image&tab=insert_choose_background&post_id=0&mysetting=myvalue">
    		<h3 class="media-title">Choose Background:</h3>
    	<input name="send" id="send" class="button" value="Insert into Post" type="submit">
    	</form>
    <?php
    }

    and it didn't worked. i tried playing with the information that sends with the action call in the form (e.g. tab=insert_choose_background and so on...), but i got nothing...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.