CustomizeStoreWithBlocks.php
2 years ago
CustomizingProductCatalog.php
1 year ago
EUVATNumber.php
2 years ago
EditProductsOnTheMove.php
2 years ago
EmailImprovements.php
1 year ago
FirstProduct.php
1 year ago
GivingFeedbackNotes.php
3 years ago
InstallJPAndWCSPlugins.php
4 weeks ago
LaunchChecklist.php
2 years ago
MagentoMigration.php
2 years ago
ManageOrdersOnTheGo.php
2 years ago
MarketingJetpack.php
4 weeks ago
MigrateFromShopify.php
2 years ago
MobileApp.php
2 years ago
NewSalesRecord.php
3 years ago
NoteActionForbiddenException.php
4 weeks ago
OnboardingPayments.php
2 years ago
OnlineClothingStore.php
2 years ago
OrderMilestones.php
2 years ago
PaymentsMoreInfoNeeded.php
5 months ago
PaymentsRemindMeLater.php
5 months ago
PerformanceOnMobile.php
2 years ago
PersonalizeStore.php
3 years ago
RealTimeOrderAlerts.php
2 years ago
ScheduledUpdatesPromotion.php
5 months ago
SellingOnlineCourses.php
2 years ago
TrackingOptIn.php
1 year ago
UnsecuredReportFiles.php
2 years ago
WooCommercePayments.php
2 years ago
WooCommerceSubscriptions.php
2 years ago
WooSubscriptionsNotes.php
1 year ago
NoteActionForbiddenException.php
37 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Note Action Forbidden Exception. |
| 4 | */ |
| 5 | |
| 6 | declare( strict_types=1 ); |
| 7 | |
| 8 | namespace Automattic\WooCommerce\Internal\Admin\Notes; |
| 9 | |
| 10 | defined( 'ABSPATH' ) || exit; |
| 11 | |
| 12 | /** |
| 13 | * Thrown by internal WooCommerce handlers on the `woocommerce_note_action[_*]` |
| 14 | * hooks to signal that the current user lacks the per-action capability the |
| 15 | * handler enforces. |
| 16 | * |
| 17 | * `Automattic\WooCommerce\Admin\API\NoteActions::trigger_note_action()` catches |
| 18 | * this exception and converts it to a 403 REST response. Any other exception |
| 19 | * type bubbles uncaught so genuine server faults are not masked as auth errors. |
| 20 | * |
| 21 | * Hook abort behavior: when a handler throws, `WP_Hook::do_action()` does not |
| 22 | * catch the exception, so any lower-priority callbacks registered on the same |
| 23 | * `woocommerce_note_action_<name>` hook are silently skipped, and |
| 24 | * `Notes::trigger_note_action()` does not run its post-hook |
| 25 | * `$note->set_status()`/`$note->save()` step — keeping the note actionable in |
| 26 | * the inbox. |
| 27 | * |
| 28 | * This is an internal contract used by first-party note-action handlers in the |
| 29 | * `Internal\\Admin\\Notes\\` namespace. Third-party extensions hooking into |
| 30 | * `woocommerce_note_action[_*]` should not rely on this class — its API and |
| 31 | * existence may change. |
| 32 | * |
| 33 | * @internal |
| 34 | * @since 10.9.0 |
| 35 | */ |
| 36 | class NoteActionForbiddenException extends \Exception {} |
| 37 |