WordPress.org

Ready to get started?Download WordPress

Forums

How do you load top-level wordpress plugin menu page into built-in thickbox? (1 post)

  1. gazotem
    Member
    Posted 3 years ago #

    I have created a top level menu item via the add_object_page method and admin_menu hook. I want to be able to utilize the media_buttons hook and the plugins functionality there. I would like to have the Thickbox pop-up load the same HTML that is loaded when I click on the menu items.

    IE:

    TOP LEVEL MENU (unique ID= TLmenu)

    * edit
    * create

    For example, for the media_button hook, I have set the URL to be: admin.php?page=TLmenu&action=create&TB_iframe=1

    This loads the content into an iFrame within the Thickbox. The (perhaps obvious?) problem is, the whole admin dashboard is loaded into the pop-up (left-sidebar, header and all) and I am curious is there some flag, setting or some logic I am missing?

    I am using the media_buttons hook, which I cannot find too much support on.

    function my_media_buttons() {
    		$title = __( 'Add Media', 'my' );
    		echo "<a href='admin.php?page=TLmenu&action=create&TB_iframe=1'  id='add_media' class='thickbox' title='$title'><img src='' alt='$title' /></a>";
    	}
    
    add_action('media_buttons', 'my_media_buttons');

Topic Closed

This topic has been closed to new replies.

About this Topic