Making Comments, a sub_menu in admin menu

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’);

Additional menu item popping in submenus

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

How to hide Admin Tabs? [duplicate]

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

get_posts ignoring ‘category’ and displaying all posts

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

How to rename Profile link in wp-admin page

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)