How can I activate Collapse Menu in WordPress?

You have to trigger the click event. Try, jQuery(document).ready(function() { jQuery(“#collapse-menu”).trigger(‘click’); }); Update: Use the following code to check if menu is already folded, if not trigger click event to fold it. jQuery(document).ready(function() { if ( !$(document.body).hasClass(‘folded’) ) { jQuery(“#collapse-menu”).trigger(‘click’); } });

Custom taxonomy admin page

Not sure why I didn’t think of this earlier. I suppose I was hoping for a way to ‘hijack’ the default page to display something else… Anyway following my original method: If you want a custom admin page for a taxonomy, you can set ‘show_ui’ => false when you register it to suppress the default … Read more

How to publish page that can’t be detected by search engines?

How about something like this on your functions.php: add_action(‘wp_head’, ‘no_robots_on_uncategorized_posts’); function no_robots_on_uncategorized_posts() { if(in_category(‘uncategorized’)) { wp_no_robots(); } } This will output the following line of code on the header of your ‘uncategorized’ posts: <meta name=”robots” content=”noindex,nofollow” /> What this means is that even though search engines will see the page, they will be told to … Read more

Calling a shortcode in the backend

As you noticed, the plugin use an instance of the class TablePress_Frontend_Controller to render the shortcode. This instance is created by only on frontend requests, this is the reason why shortcode doesn’t work on backend. The function tablepress_print_table function use the TablePress_Frontend_Controller::shortcode_table method to render the table, and this is the reason why also that … Read more

Admin Notices coding standard issue

One way you can handle this would be to do the wp_sprintf when assigning the value of the $message variable and then use wp_kses when you want to output. You could also output the div and paragraph tags before and after the message, which would eliminate the need for wp_sprintf in this instance. add_action( ‘admin_notices’, … Read more

Getting Rid of the WordPress.com Toolbar on Other Sites?

Add the following code to your user stylesheet: #wpcombar { height: 2px !important; overflow: hidden !important; } #wpcombar:hover, #wpcombar:focus { height: 28px !important; } This will shrink down the toolbar to a 2px line. You may use display:none to remove it completely, but then it will not be accessible when you need it.