Autoload woocommerce_allow_tracking option (#52512)

This commit is contained in:
Adrian Duffell 2024-11-11 17:10:19 +08:00 committed by GitHub
parent f8a2c9358f
commit 779e00ed02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: tweak
Add autoloading for woocommerce_allow_tracking option

View File

@ -354,7 +354,7 @@ class WC_Settings_Advanced extends WC_Settings_Page {
'type' => 'checkbox',
'checkboxgroup' => 'start',
'default' => 'no',
'autoload' => false,
'autoload' => true,
),
array(
'type' => 'sectionend',

View File

@ -272,6 +272,7 @@ class WC_Install {
),
'9.5.0' => array(
'wc_update_950_add_brands_enabled_option',
'wc_update_950_tracking_option_autoload',
),
);

View File

@ -2927,3 +2927,13 @@ function wc_update_940_remove_help_panel_highlight_shown() {
function wc_update_950_add_brands_enabled_option() {
add_option( 'wc_feature_woocommerce_brands_enabled', 'yes' );
}
/**
* Autoloads woocommerce_allow_tracking option.
*/
function wc_update_950_tracking_option_autoload() {
$options = array(
'woocommerce_allow_tracking' => 'yes',
);
wp_set_option_autoload_values( $options );
}