Merge pull request #8394 from aaemnnosttv/pr/settings-for-email-classes
Fix settings for email classes
This commit is contained in:
commit
ef2b32a0be
|
@ -47,10 +47,10 @@ class WC_Settings_Emails extends WC_Settings_Page {
|
||||||
$mailer = WC()->mailer();
|
$mailer = WC()->mailer();
|
||||||
$email_templates = $mailer->get_emails();
|
$email_templates = $mailer->get_emails();
|
||||||
|
|
||||||
foreach ( $email_templates as $email_id => $email ) {
|
foreach ( $email_templates as $email_key => $email ) {
|
||||||
$title = empty( $email->title ) ? ucfirst( $email->id ) : ucfirst( $email->title );
|
$title = empty( $email->title ) ? ucfirst( $email->id ) : ucfirst( $email->title );
|
||||||
|
|
||||||
$sections[ strtolower( $email_id ) ] = esc_html( $title );
|
$sections[ strtolower( $email_key ) ] = esc_html( $title );
|
||||||
}
|
}
|
||||||
|
|
||||||
return apply_filters( 'woocommerce_get_sections_' . $this->id, $sections );
|
return apply_filters( 'woocommerce_get_sections_' . $this->id, $sections );
|
||||||
|
@ -174,9 +174,9 @@ class WC_Settings_Emails extends WC_Settings_Page {
|
||||||
|
|
||||||
if ( $current_section ) {
|
if ( $current_section ) {
|
||||||
|
|
||||||
foreach ( $email_templates as $email ) {
|
foreach ( $email_templates as $email_key => $email ) {
|
||||||
|
|
||||||
if ( strtolower( get_class( $email ) ) == $current_section ) {
|
if ( strtolower( $email_key ) == $current_section ) {
|
||||||
$email->admin_options();
|
$email->admin_options();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue