0

Im trying to generate a duplicate page "edit.php" of the post_type "shop_order" beacuse i want the normal one from woocommerce and a custom one to add my code and columns.

Searching in google i find how to create edit.php for custom post types but no how to "replicate" the edit.php for existing post types.

I would put an example of what I have done but nothing has given any result...

Thanks all for your help and sorry for my english.

Here is the code i tryied but it only shows the top menu, the sub menu doesn't show.

add_action('admin_menu','add_my_menus', 10, 2);
function add_my_menus( ) { 
    add_menu_page(
        'Top Menu',
        'Top Menu',
        'manage_options',
        'topmymenu');
        
    add_submenu_page( 
        'edit.php?post_type=shop_order', 
        'submenu', 
        'submenu', 
        'manage_options', 
        'submymenu',
        'render_my_submenu' 
    );
}

function render_my_submenu() {
    echo 'Custom Link Page';
}
  • Could you explain in brief? – Pradipta Sarkar Aug 25 at 4:00
  • I need to create another submenu in Woocommerce top menu that looks exactly like Woocommerce -> Orders. – CrowDev Aug 25 at 4:10
  • You need to use add_submenu_page functions. – Pradipta Sarkar Aug 25 at 4:14
  • I edit with the code i try but it doesn't work, thanks. – CrowDev Aug 25 at 6:41

Your Answer

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

Browse other questions tagged or ask your own question.