Dynamically generate email settings section names in page controller.

This commit is contained in:
Jeff Stieler 2019-05-14 11:36:31 -06:00
parent a9195efb16
commit 93217253ac
1 changed files with 4 additions and 14 deletions

View File

@ -257,26 +257,16 @@ class WC_Admin_Page_Controller {
);
// Tabs that have sections as well.
$wc_emails = WC_Emails::instance();
$wc_email_ids = array_map( 'sanitize_title', array_keys( $wc_emails->get_emails() ) );
$tabs_with_sections = apply_filters(
'wc_admin_page_tab_sections',
array(
'products' => array( '', 'inventory', 'downloadable' ),
'shipping' => array( '', 'options', 'classes' ),
'checkout' => array( 'bacs', 'cheque', 'cod', 'paypal' ),
'email' => array(
// @todo: dynamically generate this.
'wc_email_new_order',
'wc_email_cancelled_order',
'wc_email_failed_order',
'wc_email_customer_on_hold_order',
'wc_email_customer_processing_order',
'wc_email_customer_completed_order',
'wc_email_customer_refunded_order',
'wc_email_customer_invoice',
'wc_email_customer_note',
'wc_email_customer_reset_password',
'wc_email_customer_new_account',
),
'email' => $wc_email_ids,
'advanced' => array(
'',
'keys',