Associating custom submenu item with post type of top level menu item

You need the information about the current post type in your callback function that renders the submenu page output. And at this point there is a lot of information ready: add_action( ‘admin_menu’, ‘wpse_60730_demo_submenu’ ); /** * Register sub menu pages. * * Note that get_current_screen() is still NULL now. * * @wp-hook admin_menu * @return … Read more

Link to post author but exclude administrator (on single.php)

You can use the wordpress function user_can that accepts as arguments the id of the user and a string representing a capability or a role name (‘administrator’ in your case ) and returns a boolean value. http://codex.wordpress.org/Function_Reference/user_can Referred to your code you can try this <?php if( !user_can( get_the_author_meta( ‘ID’ ), ‘administrator’ ) ): ?> … Read more

Admin page redirect to another admin page

You can use get_current_screen() to check on which page you are then make a redirect to specific admin page. get_current_screen() return the screen object like WP_Screen Object ( [action] => [base] => dashboard [columns:WP_Screen:private] => 0 [id] => dashboard [in_admin:protected] => site [is_network] => [is_user] => [parent_base] => [parent_file] => [post_type] => [taxonomy] => [_help_tabs:WP_Screen:private] … Read more

Hide Updates from Admins that don’t equal a set Username

You could try following: $current_user = wp_get_current_user(); if( user_can( $current_user, ‘main-admin’ ) ) { // Do your stuff } For more info please read in the Codex about: user_can , wp_get_current_user Edit: my mistake, was reading wrong, I thought you meant a custom role main-admin. Not to make my mistake suddenly as correct, but maybe … Read more

How do I change Administrator to Super Administrator

What RST said. “SuperAdmins” are for network (multi-site) only. That user has ability to be the admin of all sub-sites. “Admin” is the highest level for non-multi-site (non-network) sites. (added as an answer to show that this question is answered by a comment to the question).

Change home-url in dashboard

Try this. Even if you want to change “View Site” link then remove “site-name” and add “view-site” in get_node. Thanks. add_action( ‘admin_bar_menu’, ‘customize_my_wp_admin_bar’, 80 ); function customize_my_wp_admin_bar( $wp_admin_bar ) { $site_node = $wp_admin_bar->get_node(‘site-name’); //Change link $site_node->href = home_url().’/velkommen’; //Update Node. $wp_admin_bar->add_node($site_node); }

Change admin logout URL

The quickest way to do this is through an Apache rewrite via mod_rewrite. You’ll also have to tell WordPress where to points its login links using the login_url and logout_url filters. return apply_filters(‘login_url’, $login_url, $redirect); return apply_filters(‘logout_url’, $logout_url, $redirect);

Adding another “Add Post” button to admin

Unfortunately this isn’t possible (without a slight hack)- since there are no hooks provided (see for example the edit.php page). A quick and easy hack is to use JavaScript to add the link after the usual ‘Add New’ link. Here I’ve used the admin_print_footer_scripts hook (on ‘post’, or ‘edit-post’ screens) to print the JavaScript. Note … Read more