How to display TinyMCE HTML view?

After analyzing sources of /wp-admin/ I realized that TinyMCE HTML view is just another textarea… Anyways, here’s the answer (everything works like a charm excepting the “img” button, but you can hide it easily with CSS – #ed_img {display: none} ). <div id=”postdivrich” class=”postarea”> <div id=”editor-toolbar”> <script type=”text/javascript” src=”http://localhost/wordpress/wp-includes/js/quicktags.js?ver=20110502″></script> <script type=”text/javascript”>edToolbar()</script> </div> <div id=’editorcontainer’> <textarea … Read more

Pause plugin option page until all data manipulation is complete

You can only do this by “loading content into all the posts in the blog” asynchronously (in the background). So, move the processing inside a function that you hook on wp_ajax_your_action_tag. Then call this function with javascript by requesting WP to fire “your_action_tag”. There’s a example on the linked page… If you want to display … Read more

using wp_cache in plugin

If you move to using BBpress 2, BBpress 2 uses custom post types and is a plugin of WordPress. This would let you do the above query using standard WordPress calls, and WP_Query. You would then automatically inherit all of the caching systems WordPress uses, and support for things like W3 Total Cache DB caching … Read more

Adding a jQuery modal dialog to the admin area

Don’t know if this could help you, I used this to manage a image field from a meta-box in the post admin page : add_action( ‘load-post.php’, ‘ImageOnSlider_scripts’ ); add_action( ‘load-post-new.php’, ‘ImageOnSlider_scripts’ ); function ImageOnSlider_scripts() { wp_enqueue_script(‘media-upload’); wp_enqueue_script(‘thickbox’); wp_register_script(‘my-upload’, WP_THEME_URL.’/js/name_of_script.js’, array(‘jquery’,’media-upload’,’thickbox’)); wp_enqueue_script(‘my-upload’); wp_enqueue_style(‘thickbox’); } and the JS : jQuery(document).ready(function() { jQuery(‘#upload_image_button’).click(function() { formfield = jQuery(‘#input-ImageOnSlider’).attr(‘name’); tb_show(”, … Read more