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 would like to show my retrieved content form my classes method in thickbox. How could I do this? I have been adding the proper id to my desired hyperlink but all of the admin body is getting parsed inside of the thickbox.

<a href="?page=blahblah&TB_iframe=true&width=600&height=550" class="thickbox">Click</a>


calss myAdmin{

public function__construct(){

}

public function myfunction(){

echo '<div class="css_class">The content of my thickbox</div>';

}

}
share|improve this question
add comment

1 Answer

Below, an example of what's needed to use ThickBox.

<?php     
wp_enqueue_style('thickbox');
wp_enqueue_script('thickbox');    
?>

<a href="#" id="taxonomy_banner_image" class="taxonomy_banner_image"> 
Click Here
</a>

<script type="text/javascript">
jQuery(document).ready(function() {   
    jQuery("#taxonomy_banner_image").click(function() {                 
        tb_show("", "filename?TB_iframe=true");
        return false;
    });
});             
</script>

tb_show parameters:

  1. title of the box.
  2. url of file and with parameter iframe=true

I think this will give you an idea how to use the ThickBox. If you face any problem, let me know.

share|improve this answer
    
thank you for your feedback, but still having problem to do not have all the content of admin page wrapped –  fefe Dec 22 '12 at 11:30
1  
@fefe and Arvind, take a look at this Answer, you need to intercept the thickbox and add iframe_header(), iframe_footer() and exit. –  brasofilo Jan 6 '13 at 19:38
    
You can also use the function add_thickbox() as alternative to enqueue the script and style. Is a little bid easier and fast forward. –  bueltge Jan 23 '13 at 14:24
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.