1

I am new to WordPress development, hope this is not a too stupid question.

I want to Move my "Camp" Page(that appear Under Pages -> Camp) into Dashboard Main menu,

if its not possible to move page then tell me how to create shortcut in main menu

see the below screenshotenter image description here

I don't want to create custom post type because when i click the "Camp" I want to display(see the below screenshot)

enter image description here

EDIT

After Added this code

add_action( 'admin_menu', function() {
    add_submenu_page(
        'edit.php?post_type=page',
        'camp',
        'camp',
        'edit_pages',
        'post.php?post=128&action=edit'
    );
});

It's look like

enter image description here

now my Question is How to Display 'camp' after my custom post types.

For Example i want to display this order

1) Testimonials

2) Reviews

3) camp

Which slug to use in,

$parent_slug,
  • I could be wrong but I seriously doubt this is possible. Frankly, you are asking someone to invest no small amount of time to save you two clicks for editing a page. Find the ID of your "camp" page and create a browser bookmark instead: domainname/wp-admin/post.php?post=IDFORPAGE&action=edit. That will always load the edit screen for your page. – jdm2112 Dec 24 '14 at 14:56
1

If you look at the browser’s address bar on that page’s edit screen, you see something like this:

wp-admin/post.php?post=91&action=edit

The 91 is the post id. This is the important information, you can create a sub menu page for that now.

To add a page to the the admin menu, use the hook admin_menu and the function add_submenu_page(). Set the page menu as parent and the URL of the Camp page as menu URL:

add_action( 'admin_menu', function() {
    add_submenu_page(
        'edit.php?post_type=page',
        'Camp',
        'Camp',
        'edit_pages',
        'post.php?post=91&action=edit'
    );
});

That’s all. :)

  • Your fix is working, but i have another doubt, i updated my question please check – Relax Jan 16 '15 at 16:46
0

I have used

add_menu_page

function to achieve the solution

add_action( 'admin_menu', 'register_my_custom_menu_page' );

function register_my_custom_menu_page() {
    add_menu_page( 
        'camp', 
        'Camp', 
        'edit_pages', 
        'post.php?post=128&action=edit', 
        '', 
        'dashicons-admin-home', 
        11 
    );
}

After use this code,

enter image description here

In the above screen shot 'Camp' Appear in Dashboard Perfectly

This is Exactly what i am needed

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.