-
Home
-
Constant Contact Forms
- Tips
How to Hide Constant Contact Forms for WordPress Admin Menus
function plt_hide_constant_contact_forms_menus() {
//Hide "Contact Form".
remove_menu_page('edit.php?post_type=ctct_forms');
//Hide "Contact Form → Forms".
remove_submenu_page('edit.php?post_type=ctct_forms', 'edit.php?post_type=ctct_forms');
//Hide "Contact Form → Add New Form".
remove_submenu_page('edit.php?post_type=ctct_forms', 'post-new.php?post_type=ctct_forms');
//Hide "Contact Form → Connect Now".
remove_submenu_page('edit.php?post_type=ctct_forms', 'ctct_options_connect');
//Hide "Contact Form → Settings".
remove_submenu_page('edit.php?post_type=ctct_forms', 'ctct_options_settings_general');
//Hide "Contact Form → About".
remove_submenu_page('edit.php?post_type=ctct_forms', 'ctct_options_about');
}
add_action('admin_menu', 'plt_hide_constant_contact_forms_menus', 1000);
Where do I put this code?
How to Hide Constant Contact Forms for WordPress Meta Boxes
function plt_hide_constant_contact_forms_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "List Information" meta box.
remove_meta_box('ctct_list_metabox', $screen->id, 'normal');
//Hide the "Form Description" meta box.
remove_meta_box('ctct_0_description_metabox', $screen->id, 'normal');
//Hide the "Constant Contact List" meta box.
remove_meta_box('ctct_0_list_metabox', $screen->id, 'normal');
//Hide the "Form Options" meta box.
remove_meta_box('ctct_1_optin_metabox', $screen->id, 'normal');
//Hide the "Form Fields" meta box.
remove_meta_box('ctct_2_fields_metabox', $screen->id, 'normal');
//Hide the "Shortcode" meta box.
remove_meta_box('ctct_2_generated_metabox', $screen->id, 'side');
//Hide the "Email settings" meta box.
remove_meta_box('email_settings', $screen->id, 'side');
//Hide the "Form Design" meta box.
remove_meta_box('ctct_1_custom_form_css_metabox', $screen->id, 'side');
//Hide the "Input Design" meta box.
remove_meta_box('ctct_1_custom_input_css_metabox', $screen->id, 'side');
//Hide the "Reset Styles" meta box.
remove_meta_box('ctct_3_reset_css_metabox', $screen->id, 'side');
}
add_action('add_meta_boxes', 'plt_hide_constant_contact_forms_metaboxes', 20);