Articles of admin

Removing the “Popular Terms” area from the Taxonomy Edit Screen in the Admin Area

Personally I really dislike how wordpress shows all the “popular terms” in different sizes on the taxonomy add/edit screen in the admin area. Does anyone know of a way to either remove this entire area completely by adding code to your functions.php file and/or how to just change this specific area so that none of […]

Disable HTML (Text) Tab in Post Editor

I am attempting to disable the Text tab in the post editor but not having any luck. The first thing I want to do is set the Visual editor to be the default but this code does not work (it is being called from a MU plugin): apply_filters( ‘wp_default_editor’, ‘tinymce’ ); Next, I want to […]

Why are my styles being applied to the admin area?

All my enqueued styles are applied to the back-end as well. I have never encountered this behavior before. Here’s my code: wp_register_style( ‘main-styles’, get_stylesheet_directory_uri() . ‘/css/styles.css’, false, ‘1.0.0’, ‘all’); wp_enqueue_style(‘main-styles’);

How to prevent parent admin page from appearring as a child admin page

I am using this code: add_menu_page($page_title, $menu_title, $this->capability, $menu_slug, $function); Which is adding top level admin page. When I add: add_submenu_page( $menu_slug, ‘sub menu 1’, ‘sub menu 1’, $this->capability, $menu_slug . ‘_sub_menu_page_1’, $function ); I get not only the desired child page, but also the parent page moves to become a child page of itself.

Admin Menus – Name Menu different from first Submenu

This question already has an answer here: add_menu_page() with different name for first submenu item 3 answers

Remove the whole menu in the admin

How can i remove the whole menu in the admin? I have this code: function remove_menu_items() { global $menu; end( $menu ); while ( prev($menu) ) { $value = explode( ‘ ‘, $menu[ key($menu) ][0] ); if ( $value[0] != NULL ? $value[0] : “” ) { unset( $menu[ key($menu) ] ); } } } […]

$user_id vs. is_user_logged_in()

I found a code scrap on the internet which uses if($user_id) { instead of if ( is_user_logged_in() ) { to check if the user is logged in. I would assume that the first would be slightly faster because it’s not running a function, but can anyone verify that this would always work?

How can I allow a custom taxonomy for certain roles?

Im trying to only show a taxonomy for the editor and administrator but I haven’t found a solution on SO or here. The closest thing I was able to find was How do I remove a taxonomy from WordPress? on SO. What is the proper way to only allow the taxonomy for the editor and […]

Hide content-box on specific pages (in admin)?

Is this possible to do somehow? In some pages i use a custom box plugin and i don’t need to show the content box on some of those pages. Is it possible to hide it by page template? Or ID if template is not possible?

Remove whitespace at the end of posts?

My writer has a tendency to add extra newlines (Enter key) and spaces (space bar) at the ends of posts. Sometimes this results in inches of extra whitespace onscreen! Is there a way I can make sure extra trailing whitespace is removed when he hits “Update” in the WordPress post editor?