REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.02 KB
Close
/home/nshryvcy/taramarriagebureau.com/wp-content/plugins/woocommerce/src/StoreApi/Utilities/NoticeHandler.php
Text
Base64
<?php namespace Automattic\WooCommerce\StoreApi\Utilities; use Automattic\WooCommerce\StoreApi\Exceptions\RouteException; use WP_Error; /** * NoticeHandler class. * Helper class to handle notices. */ class NoticeHandler { /** * Convert queued error notices into an exception. * * For example, Payment methods may add error notices during validate_fields call to prevent checkout. * Since we're not rendering notices at all, we need to convert them to exceptions. * * This method will find the first error message and thrown an exception instead. Discards notices once complete. * * @throws RouteException If an error notice is detected, Exception is thrown. * * @param string $error_code Error code for the thrown exceptions. */ public static function convert_notices_to_exceptions( $error_code = 'unknown_server_error' ) { if ( 0 === wc_notice_count( 'error' ) ) { wc_clear_notices(); return; } $error_notices = wc_get_notices( 'error' ); // Prevent notices from being output later on. wc_clear_notices(); foreach ( $error_notices as $error_notice ) { throw new RouteException( $error_code, wp_strip_all_tags( $error_notice['notice'] ), 400 ); } } /** * Collects queued error notices into a \WP_Error. * * For example, cart validation processes may add error notices to prevent checkout. * Since we're not rendering notices at all, we need to catch them and group them in a single WP_Error instance. * * This method will discard notices once complete. * * @param string $error_code Error code for the thrown exceptions. * * @return \WP_Error The WP_Error object containing all error notices. */ public static function convert_notices_to_wp_errors( $error_code = 'unknown_server_error' ) { $errors = new WP_Error(); if ( 0 === wc_notice_count( 'error' ) ) { return $errors; } $error_notices = wc_get_notices( 'error' ); foreach ( $error_notices as $error_notice ) { $errors->add( $error_code, wp_strip_all_tags( $error_notice['notice'] ) ); } return $errors; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 18
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
ArrayUtils.php
1.49 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CartController.php
47.46 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CheckoutTrait.php
10.24 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DraftOrderTrait.php
1.76 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
JsonWebToken.php
5.07 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LocalPickupUtils.php
2.85 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
NoticeHandler.php
2.02 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
OrderAuthorizationTrait.php
3.25 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
OrderController.php
27.25 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Pagination.php
2.05 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PaymentUtils.php
3.58 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ProductItemTrait.php
2.95 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ProductQuery.php
18.96 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ProductQueryFilters.php
8.01 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
QuantityLimits.php
9.87 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RateLimits.php
6.14 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SanitizationUtils.php
794 B
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ValidationUtils.php
1.73 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).