AI
1 year ago
RateLimits
4 weeks ago
Reports
4 weeks ago
Templates
3 years ago
views
4 weeks ago
AnalyticsImports.php
5 months ago
Coupons.php
4 years ago
CustomAttributeTraits.php
4 years ago
Customers.php
4 years ago
Data.php
4 years ago
DataCountries.php
4 years ago
DataDownloadIPs.php
4 years ago
Experiments.php
4 years ago
Features.php
4 years ago
Init.php
4 weeks ago
LaunchYourStore.php
1 year ago
Leaderboards.php
1 year ago
Marketing.php
2 months ago
MarketingCampaignTypes.php
3 years ago
MarketingCampaigns.php
2 years ago
MarketingChannels.php
3 years ago
MarketingOverview.php
2 months ago
MarketingRecommendations.php
2 years ago
MobileAppMagicLink.php
3 years ago
MobileAppQRLogin.php
4 weeks ago
NoteActions.php
4 weeks ago
Notes.php
4 weeks ago
Notice.php
1 year ago
OnboardingFreeExtensions.php
1 year ago
OnboardingPlugins.php
4 weeks ago
OnboardingProductTypes.php
4 years ago
OnboardingProducts.php
2 years ago
OnboardingProfile.php
1 year ago
OnboardingTasks.php
9 months ago
OnboardingThemes.php
9 months ago
Options.php
4 weeks ago
Orders.php
1 year ago
PaymentGatewaySuggestions.php
2 months ago
Plugins.php
2 months ago
ProductAttributeTerms.php
4 years ago
ProductAttributes.php
4 years ago
ProductCategories.php
4 years ago
ProductForm.php
3 years ago
ProductReviews.php
4 years ago
ProductVariations.php
1 year ago
Products.php
1 year ago
ProductsLowInStock.php
4 months ago
SettingOptions.php
3 years ago
ShippingPartnerSuggestions.php
1 month ago
Taxes.php
4 years ago
Themes.php
2 years ago
SettingOptions.php
43 lines
| 1 | <?php |
| 2 | /** |
| 3 | * REST API Setting Options Controller |
| 4 | * |
| 5 | * Handles requests to /settings/{option} |
| 6 | */ |
| 7 | |
| 8 | namespace Automattic\WooCommerce\Admin\API; |
| 9 | |
| 10 | defined( 'ABSPATH' ) || exit; |
| 11 | |
| 12 | use Automattic\WooCommerce\Admin\API\Reports\Cache as ReportsCache; |
| 13 | |
| 14 | /** |
| 15 | * Setting Options controller. |
| 16 | * |
| 17 | * @internal |
| 18 | * @extends WC_REST_Setting_Options_Controller |
| 19 | */ |
| 20 | class SettingOptions extends \WC_REST_Setting_Options_Controller { |
| 21 | |
| 22 | /** |
| 23 | * Endpoint namespace. |
| 24 | * |
| 25 | * @var string |
| 26 | */ |
| 27 | protected $namespace = 'wc-analytics'; |
| 28 | |
| 29 | /** |
| 30 | * Invalidates API cache when updating settings options. |
| 31 | * |
| 32 | * @param WP_REST_Request $request Full details about the request. |
| 33 | * @return array Of WP_Error or WP_REST_Response. |
| 34 | */ |
| 35 | public function batch_items( $request ) { |
| 36 | // Invalidate the API cache. |
| 37 | ReportsCache::invalidate(); |
| 38 | |
| 39 | // Process the request. |
| 40 | return parent::batch_items( $request ); |
| 41 | } |
| 42 | } |
| 43 |