rebase on oct-10-2023

This commit is contained in:
Rachit Bhargava
2023-10-10 17:23:21 -04:00
parent d37566ffb6
commit d096058d7d
4789 changed files with 254611 additions and 307223 deletions

View File

@@ -212,6 +212,21 @@ abstract class WC_Settings_API {
if ( 'title' !== $this->get_field_type( $field ) ) {
try {
$this->settings[ $key ] = $this->get_field_value( $key, $field, $post_data );
if ( 'select' === $field['type'] || 'checkbox' === $field['type'] ) {
/**
* Notify that a non-option setting has been updated.
*
* @since 7.8.0
*/
do_action(
'woocommerce_update_non_option_setting',
array(
'id' => $key,
'type' => $field['type'],
'value' => $this->settings[ $key ],
)
);
}
} catch ( Exception $e ) {
$this->add_error( $e->getMessage() );
}
@@ -219,8 +234,8 @@ abstract class WC_Settings_API {
}
$option_key = $this->get_option_key();
do_action( 'woocommerce_update_option', array( 'id' => $option_key ) );
return update_option( $option_key, apply_filters( 'woocommerce_settings_api_sanitized_fields_' . $this->id, $this->settings ), 'yes' );
do_action( 'woocommerce_update_option', array( 'id' => $option_key ) ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
return update_option( $option_key, apply_filters( 'woocommerce_settings_api_sanitized_fields_' . $this->id, $this->settings ), 'yes' ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
}
/**
@@ -729,7 +744,7 @@ abstract class WC_Settings_API {
'options' => array(),
);
$data = wp_parse_args( $data, $defaults );
$data = wp_parse_args( $data, $defaults );
$value = $this->get_option( $key );
ob_start();