Backwards compatibility

This commit is contained in:
Mike Jolley 2016-02-26 15:26:39 +00:00
parent 346b25d01b
commit c3554490b5
2 changed files with 4 additions and 6 deletions

View File

@ -241,10 +241,8 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
$payment_gateways = WC()->payment_gateways->payment_gateways();
if ( $current_section ) {
foreach ( $payment_gateways as $gateway ) {
if ( strtolower( $current_section ) === $gateway->id ) {
if ( in_array( $current_section, array( $gateway->id, sanitize_title( get_class( $gateway ) ) ) ) ) {
$gateway->admin_options();
break;
}
@ -349,7 +347,7 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
} else {
foreach ( $wc_payment_gateways->payment_gateways() as $gateway ) {
if ( strtolower( $current_section ) === $gateway->id ) {
if ( in_array( $current_section, array( $gateway->id, sanitize_title( get_class( $gateway ) ) ) ) ) {
do_action( 'woocommerce_update_options_payment_gateways_' . $gateway->id );
$wc_payment_gateways->init();
}

View File

@ -137,7 +137,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
return;
} else {
foreach ( $shipping_methods as $method ) {
if ( ( strtolower( $current_section ) === $method->id ) && $method->has_settings() ) {
if ( in_array( $current_section, array( $method->id, sanitize_title( get_class( $method ) ) ) ) && $method->has_settings() ) {
$method->admin_options();
return;
}
@ -166,7 +166,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
$wc_shipping = WC_Shipping::instance();
foreach ( $wc_shipping->get_shipping_methods() as $method_id => $method ) {
if ( strtolower( $current_section ) === $method->id ) {
if ( in_array( $current_section, array( $method->id, sanitize_title( get_class( $method ) ) ) ) ) {
do_action( 'woocommerce_update_options_' . $this->id . '_' . $method->id );
}
}