I am trying to move "my-account" page into wp-admin.
Here is my source code :
add_action( 'admin_menu', 'create_etrade_admin_menu' );
function create_etrade_admin_menu() {
add_menu_page( 'My Auctions', 'Auctions', 'manage_options', 'etrade-auction-admin-page.php', 'etrade_auction_admin_page', 'dashicons-email', 6 );
}
function etrade_auction_admin_page(){
?>
<div class="wrap">
<h1>Auctions and Bids</h1>
<?php echo do_shortcode('[woocommerce_my_account]'); ?>
</div>
<?php
}
Unfortunately it's not working.
My question is: Is it possible to use "do_shortcode()
" inside function for wp-admin area?
Or is there any other option to do this?
Preliminary remarks:
'manage_options'
capability is only for Administrator user role (used in create_etrade_admin_menu()
function).Shortcodes for backend?
My account page on Back end?
You will need to build your project from scratch, may be using some code of WooCommerce templates…
Building a backend page:
1. A backend menu access with add_menu_page()
function.
2. The submenu calling your page with add_submenu_page()
function (optional).
3. The page is build with a function which name will be called back by add_menu_page()
(and add_submenu_page()
)…
Reference: