-
Home
-
Client Invoicing by Sprout Invoices – Easy Estimates and Invoices for WordPress
- Tips
How to Hide Sprout Invoices Admin Menus
function plt_hide_sprout_invoices_menus() {
//Hide "Tools → Sprout Records".
remove_submenu_page('tools.php', 'si_records');
//Hide "Invoices".
remove_menu_page('edit.php?post_type=sa_invoice');
//Hide "Invoices → Invoices".
remove_submenu_page('edit.php?post_type=sa_invoice', 'edit.php?post_type=sa_invoice');
//Hide "Invoices → Add New Invoice".
remove_submenu_page('edit.php?post_type=sa_invoice', 'post-new.php?post_type=sa_invoice');
//Hide "Invoices → Payments".
remove_submenu_page('edit.php?post_type=sa_invoice', 'sprout-apps/invoice_payments');
//Hide "Invoices → Clients".
remove_submenu_page('edit.php?post_type=sa_invoice', 'edit.php?post_type=sa_client');
//Hide "Invoices → Projects".
remove_submenu_page('edit.php?post_type=sa_invoice', 'edit.php?post_type=sa_project');
//Hide "Estimates".
remove_menu_page('edit.php?post_type=sa_estimate');
//Hide "Estimates → Estimates".
remove_submenu_page('edit.php?post_type=sa_estimate', 'edit.php?post_type=sa_estimate');
//Hide "Estimates → Add New Estimate".
remove_submenu_page('edit.php?post_type=sa_estimate', 'post-new.php?post_type=sa_estimate');
//Hide "Sprout Invoices".
remove_menu_page('sprout-invoices');
//Hide "Sprout Invoices → Getting Started".
remove_submenu_page('sprout-invoices', 'sprout-invoices');
//Hide "Sprout Invoices → General Settings".
remove_submenu_page('sprout-invoices', 'sprout-invoices-settings');
//Hide "Sprout Invoices → Payment Processors".
remove_submenu_page('sprout-invoices', 'sprout-invoices-payments');
//Hide "Sprout Invoices → Notifications".
remove_submenu_page('sprout-invoices', 'sprout-invoices-notifications');
//Hide "Sprout Invoices → Add-ons".
remove_submenu_page('sprout-invoices', 'sprout-invoices-addons');
//Hide "Sprout Invoices → Reports".
remove_submenu_page('sprout-invoices', 'sprout-invoices-reports');
//Hide "Sprout Invoices → Tools".
remove_submenu_page('sprout-invoices', 'sprout-invoices-import');
//Hide "Sprout Invoices → Support".
remove_submenu_page('sprout-invoices', 'sprout-invoices-support');
}
add_action('admin_menu', 'plt_hide_sprout_invoices_menus', 21);
Where do I put this code?
How to Hide Sprout Invoices Meta Boxes
function plt_hide_sprout_invoices_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Update" meta box.
remove_meta_box('si_notification_submit', $screen->id, 'side');
//Hide the "Estimate Available Shortcodes" meta box.
remove_meta_box('si_notification_shortcodes_send_estimate', $screen->id, 'normal');
//Hide the "Invoice Available Shortcodes" meta box.
remove_meta_box('si_notification_shortcodes_send_invoice', $screen->id, 'normal');
//Hide the "Deposit Payment Received Shortcodes" meta box.
remove_meta_box('si_notification_shortcodes_deposit_payment', $screen->id, 'normal');
//Hide the "Payment Cleared Shortcodes" meta box.
remove_meta_box('si_notification_shortcodes_payment_cleared', $screen->id, 'normal');
//Hide the "Invoice Paid Shortcodes" meta box.
remove_meta_box('si_notification_shortcodes_final_payment', $screen->id, 'normal');
//Hide the "Payment Reminder Shortcodes" meta box.
remove_meta_box('si_notification_shortcodes_reminder_payment', $screen->id, 'normal');
//Hide the "Estimate Accepted Shortcodes" meta box.
remove_meta_box('si_notification_shortcodes_accepted_estimate', $screen->id, 'normal');
//Hide the "Estimate Declined Shortcodes" meta box.
remove_meta_box('si_notification_shortcodes_declined_estimate', $screen->id, 'normal');
//Hide the "Payment Received Shortcodes" meta box.
remove_meta_box('si_notification_shortcodes_payment_notification', $screen->id, 'normal');
//Hide the "Information" meta box.
remove_meta_box('si_client_information', $screen->id, 'normal');
//Hide the "Advanced" meta box.
remove_meta_box('si_client_advanced', $screen->id, 'normal');
//Hide the "History" meta box.
remove_meta_box('si_client_history', $screen->id, 'normal');
//Hide the "Update" meta box.
remove_meta_box('si_client_submit', $screen->id, 'side');
//Hide the "Management" meta box.
remove_meta_box('si_invoice_line_items', $screen->id, 'normal');
//Hide the "Information" meta box.
remove_meta_box('si_invoice_update', $screen->id, 'normal');
//Hide the "Invoice History" meta box.
remove_meta_box('si_invoice_history', $screen->id, 'normal');
//Hide the "Send Notification" meta box.
remove_meta_box('si_doc_send', $screen->id, 'normal');
//Hide the "Admin Payment" meta box.
remove_meta_box('si_invoice_payment', $screen->id, 'normal');
//Hide the "Terms & Notes" meta box.
remove_meta_box('si_invoice_notes', $screen->id, 'normal');
//Hide the "Management" meta box.
remove_meta_box('si_estimate_line_items', $screen->id, 'normal');
//Hide the "Information" meta box.
remove_meta_box('si_estimate_update', $screen->id, 'normal');
//Hide the "Estimate History" meta box.
remove_meta_box('si_estimate_history', $screen->id, 'normal');
//Hide the "Terms & Notes" meta box.
remove_meta_box('si_estimate_notes', $screen->id, 'normal');
//Hide the "Information" meta box.
remove_meta_box('si_project_information', $screen->id, 'normal');
//Hide the "History" meta box.
remove_meta_box('si_project_history', $screen->id, 'normal');
//Hide the "Update" meta box.
remove_meta_box('si_project_submit', $screen->id, 'side');
//Hide the "Project Panorama" meta box.
remove_meta_box('psp_project_info', $screen->id, 'side');
}
add_action('add_meta_boxes', 'plt_hide_sprout_invoices_metaboxes', 20);
How to Hide Sprout Invoices Dashboard Widgets
function plt_hide_sprout_invoices_dashboard_widgets() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Remove the "Invoices Dashboard" widget.
remove_meta_box('invoice_dashboard', 'dashboard', 'normal');
//Remove the "Estimates Dashboard" widget.
remove_meta_box('estimates_dashboard', 'dashboard', 'side');
}
add_action('wp_dashboard_setup', 'plt_hide_sprout_invoices_dashboard_widgets', 20);