-
Home
-
Pay to Read – Create paid content on your website. Monetize your website
- Tips
How to Hide Pay to Read Admin Menus
function plt_hide_pay_to_read_menus() {
//Hide "Premium Posts".
remove_menu_page('edit.php?post_type=p2r_premium_posts');
//Hide "Premium Posts → All Premium Posts".
remove_submenu_page('edit.php?post_type=p2r_premium_posts', 'edit.php?post_type=p2r_premium_posts');
//Hide "Premium Posts → Add New Premium Post".
remove_submenu_page('edit.php?post_type=p2r_premium_posts', 'post-new.php?post_type=p2r_premium_posts');
//Hide "Premium Posts → Premium Posts Category".
remove_submenu_page('edit.php?post_type=p2r_premium_posts', 'edit-tags.php?taxonomy=premium_posts_category&post_type=p2r_premium_posts');
//Hide "Pay to Read Plugin".
remove_menu_page('loopwi_p2r');
//Hide "Pay to Read Plugin → Pay to Read Plugin".
remove_submenu_page('loopwi_p2r', 'loopwi_p2r');
//Hide "Pay to Read Plugin → Settings".
remove_submenu_page('loopwi_p2r', 'loopwi_p2r_settings');
}
add_action('admin_menu', 'plt_hide_pay_to_read_menus', 11);
Where do I put this code?
How to Hide the "YOUR CHARGE FOR READERS OF READ THIS ARTICLE" Meta Box
function plt_hide_pay_to_read_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "YOUR CHARGE FOR READERS OF READ THIS ARTICLE" meta box.
remove_meta_box('p2r_box_id', $screen->id, 'advanced');
}
add_action('add_meta_boxes', 'plt_hide_pay_to_read_metaboxes', 20);