Delete old marketing recommendations transient upon update to WC 8.6.0 (#43162)
* Add MarketingRecommendations feature. The code here is based on other feature with default fallbacks and with data source poller, e.g. see payment gateway suggestions. * Use MarketingRecommendations feature in API. * Add spec_key for MarketingRecommendationsDataSourcePoller. If we don't specify it, the default is `id`, which is not used in our recommendation data, and this will cause things not to work as expected. * Recursively convert object to array. This is because all the subsequent functions work with arrays, not objects. * Make recommended marketing tools and coupons use MarketingRecommendationsInit. This is so that recommended channels, tools, and coupons make use of the same transient data with data source poller. * Add changelog. * Fix PHP lint issues. * Add doc comment to fix lint error. * Fix tests in MarketingRecommendationsTest. * Replace recommendations.json file with generated data in DefaultMarketingRecommendations. This is to have i18n support. * Add icons for fallback marketing recommendations. * Fix PHP linting issue. * Fix linting issue. * Fix failing tests with PHP 8.0. * Remove unused replaced code in MarketingSpecs. * Delete old marketing recommendations transient upon update to WC 8.6.0. * Add changelog.
This commit is contained in:
parent
e24aabff04
commit
0636a09f63
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: minor
|
||||||
|
Type: add
|
||||||
|
|
||||||
|
Delete old marketing recommendations transient upon update to WooCommerce 8.6.0.
|
|
@ -240,6 +240,9 @@ class WC_Install {
|
||||||
'8.1.0' => array(
|
'8.1.0' => array(
|
||||||
'wc_update_810_migrate_transactional_metadata_for_hpos',
|
'wc_update_810_migrate_transactional_metadata_for_hpos',
|
||||||
),
|
),
|
||||||
|
'8.6.0' => array(
|
||||||
|
'wc_update_860_remove_recommended_marketing_plugins_transient',
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2640,3 +2640,12 @@ LIMIT 250
|
||||||
return ! empty( $has_pending );
|
return ! empty( $has_pending );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the transient data for recommended marketing extensions.
|
||||||
|
*
|
||||||
|
* This is removed because it is not used anymore.
|
||||||
|
* It is replaced by `woocommerce_admin_marketing_recommendations_specs` transient that is created by `MarketingRecommendationsDataSourcePoller`.
|
||||||
|
*/
|
||||||
|
function wc_update_860_remove_recommended_marketing_plugins_transient() {
|
||||||
|
delete_transient( 'wc_marketing_recommended_plugins' );
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue