最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

custom post types - Duplicate the "Orders" list on Admin Page

programmeradmin1浏览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';
}
发布评论

评论列表(0)

  1. 暂无评论