I have pages setup and want a top level menu item to direct to editing a specific page. I'm reading through add_menu_page and it doesn't list how to get to specific pages or posts edit page. ie
Is this possible?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
You've almost answered your own question. Just pass the URL as the
add_menu_page( null, // not an actual page, so title is irrelevant 'Menu Item Name', 'edit_posts', // or whatever capability required for this object '/post.php?post=42&action=edit', null, '', 6 );
The caveat is that when you visit this menu item, the actual menu item it belongs to will be highlighted in the menu (posts, pages, media). You could fix this with a bit of JS, or just live with it.