Tag Info

New answers tagged

0

Here is another option to remove header and background (source): //Remove the custom options provided by the default twentyeleven theme. add_action( 'after_setup_theme','remove_twentyeleven_options', 100 ); function remove_twentyeleven_options() { remove_custom_background(); remove_custom_image_header(); remove_action('admin_menu', ...


0

Question #1 - The above code will output 23123 twice, when visiting plugin page and when not. How do I make it print the content of my page only when page is the current screen? Basically: http://localhost/wp-admin/admin.php?page=camden-vmtool When you initialize the class, you are hooking the pageInit() method into a hook that fires on all admin ...


3

Add this to your theme's functions.php: add_action( 'admin_bar_menu', 'make_parent_node', 999 ); function make_parent_node( $wp_admin_bar ) { if ( ! is_admin() ) { return; } // end function if not in admin back-end, credit @Rarst $args = array( 'id' => 'view-site', // id of the existing child node (View Site) 'title' => ...


5

Not complicated, but a little tricky to get timing right. Something like this should work, but you might need to experiment with priority to get the link to specific position on the bar: add_action( 'admin_bar_menu', function ( $wp_admin_bar ) { if ( ! is_admin() ) { return; } /** @var WP_Admin_Bar $wp_admin_bar */ ...


0

Here a little function which takes care to hide (In admin) Custom Post Types. function remove_from_admin_menu(){ // Check capability (admin) if( current_user_can( 'edit_dashboard' )){ //Do nothing } elseif ( current_user_can( 'moderate_comments' ) ) { // editor capability remove_menu_page( 'edit.php?post_type=cpt01' ); // add ...



Top 50 recent answers are included