How to remove and disable access to General Settings Page including its link
There is a plugin called “Admin Menu Editor” that can do just this. I have used it numerous times without issues.
There is a plugin called “Admin Menu Editor” that can do just this. I have used it numerous times without issues.
If I understand you correctly you want to create a page for your plugin which mimics the look and feel of the WordPress Dashboard and it’s option pages? If so then you can use the CSS which is packed with WordPress. The CSS file is located at wp-admin/wp-admin.css If you open that file with your … Read more
Well one way to do it would be to add a new sub menu page and just remove the old one. function wpse_80457_menu() { add_submenu_page( ‘edit.php’, ‘Comments’, ‘Comments’, ‘manage_options’, ‘edit-comments.php’); remove_menu_page( ‘edit-comments.php’ ); } add_action(‘_admin_menu’, ‘wpse_80457_menu’);
You probably cannot see the new CPT items in your menu, because you have indicated that they require specific caps, yet you have not assigned those same caps to any role – including your own. Add the following to your code: function my_cpt_add_caps() { foreach ( array( ‘administrator’ ) as $role_name ) { $role = … Read more
The third menu item that appears (in fact, the first) is the main menu: add_action(‘admin_menu’, ‘Ad_menu’); function Ad_menu() { //Main menu add_menu_page( ‘Ads page title’, ‘Ads menu title’, ‘manage_options’, ‘ad_menu_slug’, function(){ echo ‘<h1>Main menu</h1>’; } ); //Submenus add_submenu_page( ‘ad_menu_slug’, ‘View page title’, ‘View menu title’, ‘manage_options’, ‘ad_view_slug’, // <– Put main menu slug here function(){ … Read more
You could use this code (below is just an example for 3 random tabs) function disable_user_profile() { if ( !current_user_can( ‘publish_posts’ ) ) { wp_redirect( admin_url(‘index.php’) ); } } add_action( ‘load-profile.php’, ‘disable_user_profile’ ); // disable profile tab add_action( ‘load-tools.php’, ‘disable_user_profile’ ); // disable tools tab add_action( ‘load-edit.php’, ‘disable_user_profile’ ); // disable posts tab The if … Read more
Ok. After a frustrating weekend I have a workaround (but still not real reason why the simpler version worked on one install and not another!) $args = array( ‘posts_per_page’ => $pageSize, ‘offset’=> $offset, ‘tax_query’ => array( array( ‘taxonomy’ => ‘category’, ‘field’ => ‘term_id’, ‘terms’ => 9 ) ); While this is a totally workable solution, … Read more
This is very easy with post types generated by Pods. If you create a Custom Post Type with Pods, you can add this to Parent Menu ID: “edit.php?post_type=top_level_post_type”
Changing the menu title is easy enough, you just need to place this in your functions.php file – add_action(‘admin_menu’, ‘my_change_admin_menu’); function my_change_admin_menu(){ global $menu; $menu[70][0] = ‘New profile menu title’; } However, you cannot change the title of this page via WordPress, not the update button text, but if you really need to do so … Read more
The $function argument of add_menu_page should be a function that produces your page output, or if omitted, then the $menu_slug argument can be a file that when included will output the menu page. But your output right now has nothing to do with the add_menu_page call, the problem is that you’re requiring aio_dashboard.php, which has … Read more