Remove or move admin submenus under a new menu

Set the argument ‘show_in_menu’ => false while registering your post with register_post_type() would make admin menus for that post type ignored, so this is the best solution here to hide menus. If you can’t access it, you could hook a function on admin_menu to add or remove menus and submenus. Here’s an example. We did … Read more

How to remove post listing page for a custom post type

I get a way to override this problem. by using “add_action” I can able to achieve my goal. add_action(“load-edit.php”, ‘block_listing_page’); //– Block user to access post listing page function block_listing_page() { if ($_GET[“post_type”] == “your_custom_post_type”) { $args = array(‘post_type’ => ‘your_custom_post_type’, ‘post_status’ => ‘publish’); $galleryPosts = get_posts($args); if (!empty($galleryPosts) && count($galleryPosts) > 0) { wp_redirect(“post.php?post=” … Read more

Add menu option to “New Post” menu in admin bar

Use new-content : function make_parent_node($wp_admin_bar) { $args = array( ‘id’ => ‘test1234’, // id of the existing child node (New > Post) ‘title’ => ‘test’, // alter the title of existing node ‘parent’ => ‘new-content’, // set parent to false to make it a top level (parent) node ‘href’ => admin_url(‘admin.php?page=enter_timesheet’) ); $wp_admin_bar->add_node($args); } it … Read more

WordPress Plugin menu position overwrite other item

add_submenu_page(‘index.php’, __(‘Plugin Name from page’, ‘pluginname’), ‘Plugin Name’, ‘manage_options’, ‘pluginname-hello’, ‘you_call_function’ ); pluginname-hello – The slug name to refer to this menu by (should be unique for this menu). you_call_function – The function to be called to output the content for this page. More information: https://developer.wordpress.org/reference/functions/add_submenu_page/

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