-
Home
-
WPSmartContracts
- Tips
How to Hide WP Smart Contracts Admin Menus
function plt_hide_wp_smart_contracts_menus() {
//Hide "Smart Contracts Dashboard".
remove_menu_page('wpsc_dashboard');
//Hide "Smart Contracts Dashboard → Smart Contracts Dashboard".
remove_submenu_page('wpsc_dashboard', 'wpsc_dashboard');
//Hide "Smart Contracts Dashboard → Affiliate Program Banners".
remove_submenu_page('wpsc_dashboard', 'wpsc-dashboard-affp');
//Hide "Smart Contracts Dashboard → Batch Mint NFTs".
remove_submenu_page('wpsc_dashboard', 'nft-batch-mint');
//Hide "Smart Contracts Dashboard → Admin Setup Wizard".
remove_submenu_page('wpsc_dashboard', 'wpsc-admin-setup');
//Hide "Coins".
remove_menu_page('edit.php?post_type=coin');
//Hide "Coins → All Coins".
remove_submenu_page('edit.php?post_type=coin', 'edit.php?post_type=coin');
//Hide "Coins → Add New Coin".
remove_submenu_page('edit.php?post_type=coin', 'post-new.php?post_type=coin');
//Hide "Stakes".
remove_menu_page('edit.php?post_type=staking');
//Hide "Stakes → All Stake".
remove_submenu_page('edit.php?post_type=staking', 'edit.php?post_type=staking');
//Hide "Stakes → Add New Stake".
remove_submenu_page('edit.php?post_type=staking', 'post-new.php?post_type=staking');
//Hide "Crowdfundings".
remove_menu_page('edit.php?post_type=crowdfunding');
//Hide "Crowdfundings → All Crowdfundings".
remove_submenu_page('edit.php?post_type=crowdfunding', 'edit.php?post_type=crowdfunding');
//Hide "Crowdfundings → Add New Crowdfunding".
remove_submenu_page('edit.php?post_type=crowdfunding', 'post-new.php?post_type=crowdfunding');
//Hide "ICOs".
remove_menu_page('edit.php?post_type=ico');
//Hide "ICOs → All ICO".
remove_submenu_page('edit.php?post_type=ico', 'edit.php?post_type=ico');
//Hide "ICOs → Add New ICO".
remove_submenu_page('edit.php?post_type=ico', 'post-new.php?post_type=ico');
//Hide "NFT Collections".
remove_menu_page('edit.php?post_type=nft-collection');
//Hide "NFT Collections → All Collections".
remove_submenu_page('edit.php?post_type=nft-collection', 'edit.php?post_type=nft-collection');
//Hide "NFT Collections → Add New Collection".
remove_submenu_page('edit.php?post_type=nft-collection', 'post-new.php?post_type=nft-collection');
//Hide "NFT".
remove_menu_page('edit.php?post_type=nft');
//Hide "NFT → All NFT".
remove_submenu_page('edit.php?post_type=nft', 'edit.php?post_type=nft');
//Hide "NFT → Add New NFT".
remove_submenu_page('edit.php?post_type=nft', 'post-new.php?post_type=nft');
//Hide "NFT → Galleries".
remove_submenu_page('edit.php?post_type=nft', 'edit-tags.php?taxonomy=nft-gallery&post_type=nft');
//Hide "NFT → Taxonomies".
remove_submenu_page('edit.php?post_type=nft', 'edit-tags.php?taxonomy=nft-taxonomy&post_type=nft');
//Hide "NFT → Attributes".
remove_submenu_page('edit.php?post_type=nft', 'edit-tags.php?taxonomy=nft-tag&post_type=nft');
//Hide "NFT → Batch Mint NFTs".
remove_submenu_page('edit.php?post_type=nft', 'nft-batch-mint');
}
add_action('admin_menu', 'plt_hide_wp_smart_contracts_menus', 11);
Where do I put this code?
How to Hide WP Smart Contracts Meta Boxes
function plt_hide_wp_smart_contracts_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "WPSmartContracts: Coin Specification" meta box.
remove_meta_box('wpsc_cryptocurrency_metabox', $screen->id, 'normal');
//Hide the "WPSmartContracts: Smart Contract" meta box.
remove_meta_box('wpsc_smart_contract', $screen->id, 'normal');
//Hide the "WPSmartContracts: Source Code" meta box.
remove_meta_box('wpsc_code', $screen->id, 'normal');
//Hide the "WPSmartContracts: Friendly Reminder" meta box.
remove_meta_box('wpsc_reminder', $screen->id, 'normal');
//Hide the "WPSmartContracts: Tutorials & Tools" meta box.
remove_meta_box('wpsc_sidebar', $screen->id, 'side');
//Hide the "WPSmartContracts: Staking Specification" meta box.
remove_meta_box('wpsc_nft_metabox', $screen->id, 'normal');
//Hide the "WPSmartContracts: Source Code" meta box.
remove_meta_box('wpsc_code_crowd', $screen->id, 'normal');
//Hide the "WPSmartContracts: Friendly Reminder" meta box.
remove_meta_box('wpsc_reminder_crowd', $screen->id, 'normal');
//Hide the "WPSmartContracts: Crowdfunding Specification" meta box.
remove_meta_box('wpsc_crowdfunding_metabox', $screen->id, 'normal');
//Hide the "WPSmartContracts: ICO Specification" meta box.
remove_meta_box('wpsc_ico_metabox', $screen->id, 'normal');
}
add_action('add_meta_boxes', 'plt_hide_wp_smart_contracts_metaboxes', 20);