[2.3] Email settings save tweak
Allows emails to use a single common class as is done in Order Status Manager
This commit is contained in:
parent
753a22734f
commit
92c6d3d649
|
@ -202,9 +202,9 @@ class WC_Settings_Emails extends WC_Settings_Page {
|
||||||
$wc_emails = WC_Emails::instance();
|
$wc_emails = WC_Emails::instance();
|
||||||
|
|
||||||
if ( in_array( $current_section, array_map( 'sanitize_title', array_keys( $wc_emails->get_emails() ) ) ) ) {
|
if ( in_array( $current_section, array_map( 'sanitize_title', array_keys( $wc_emails->get_emails() ) ) ) ) {
|
||||||
foreach ( $wc_emails->get_emails() as $email ) {
|
foreach ( $wc_emails->get_emails() as $email_id => $email ) {
|
||||||
if ( $current_section === sanitize_title( get_class( $email ) ) ) {
|
if ( $current_section === sanitize_title( $email_id ) ) {
|
||||||
do_action( 'woocommerce_update_options_' . $this->id . '_' . $email->id );
|
do_action( 'woocommerce_update_options_' . $this->id . '_' . $email_id );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue