Articles of admin

Make parent categories not selectable

I’d like that my categories having child-categories don’t be selectable on the post article page. What I want to do is to remove the checkbox before their label. I’ve looked the filter documentation but I wasn’t able to find any filter that suits my need.

Sort wp_nav_menu() by menu order

I have made a custom menu handler for the back end, sorting the via a drag drop based on CMS Page Order. The problem now is that it seems that it’s not possible to sort wp_nav_menu in any other way than the default one, can that be really be true?

Remove Metabox from Menus screen

Been digging into WP files for a bit and think I just might be missing something. The end-goal is to remove the Theme Locations metabox from the Menus screen if someone doesn’t have a certain capability manage_options. I know, a little odd for usability, but there’s only one menu and we’re trying to make this […]

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?