How to reduce the number of revisions?

You can use define (‘WP_POST_REVISIONS’, 2); in wp-config.php for two revisions, and you could turn that into your own plugin. Manully remove all revisions with this query run in phpmyadmin: DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) WHERE a.post_type=”revision” and then … Read more

Custom page in plugin visible in menu

I found the answer on WordPress Forum: http://wordpress.org/support/topic/add-backend-page-without-menu-item#post-2135050 It requires add_submenu_page() with slug = null (first argument). In WordPress documentation it’s marked as ‘required’ so it looks like it’s required but can be null.

How to disable tinyMCE button added by a plugin?

I’ve found that you can manual set availability button by this attribute theme_advanced_buttons1 (for button in row 1) Example : function disable_mce_buttons( $opt ) { //set button that will be show in row 1 $opt[‘theme_advanced_buttons1’] = ‘bold,italic,strikethrough,|,bullist,numlist,blockquote,|,justifyleft,justifycenter,justifyright,|,link,unlink,wp_more,|,spellchecker,wp_fullscreen,wp_adv,separator’; return $opt; } add_filter(‘tiny_mce_before_init’, ‘disable_mce_buttons’);

Edit page header on a custom plugin

NOTE This code will load those scripts on all admin pages. Better you go through the Codex examples to get an idea how you can load the scripts on pages of specific plugins Here’s the code to load the custom scripts on admin pages function wpse60745_loadto_admin() { // to load styles wp_register_style( ‘my_plugin_css’, plugins_url(‘plugin-style.css’, __FILE__) … Read more

Load script only in the admin page

This is a very poorly coded plugin, and a good writer should know better. I’ve grepped through the code and found the process_post method which is hooked into init (why?!) and enqueues jquery-ui-sortable which is probably the code which breaks your code: function process_post(){ global $wp_query; wp_enqueue_script( ‘jquery-ui-sortable’, ‘/wp-includes/js/jquery/ui/jquery.ui.sortable.min.js’, array(‘jquery-ui-core’, ‘jquery-ui-mouse’), ‘1.8.20’, 1 ); } … Read more