wp-mail-smtp
Last commit date
assets
5 days ago
src
5 days ago
vendor
5 days ago
vendor_prefixed
5 days ago
polyfills.php
5 days ago
readme.txt
5 days ago
uninstall.php
5 days ago
wp-mail-smtp.php
5 days ago
wp_mail_smtp.php
5 days ago
polyfills.php
30 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Polyfills for functions missing on the plugin's supported-but-older WordPress and PHP versions. |
| 4 | * |
| 5 | * Must stay in the global namespace so the backfilled functions are reachable by the same |
| 6 | * unqualified names their callers use. Required from wp-mail-smtp.php before the plugin boots. |
| 7 | * |
| 8 | * @since 4.9.0 |
| 9 | */ |
| 10 | |
| 11 | if ( ! defined( 'ABSPATH' ) ) { |
| 12 | exit; // Exit if accessed directly. |
| 13 | } |
| 14 | |
| 15 | if ( ! function_exists( 'wp_is_serving_rest_request' ) ) { |
| 16 | /** |
| 17 | * Backfill of WP 6.5's wp_is_serving_rest_request() for older WordPress. |
| 18 | * |
| 19 | * Action Scheduler 4.0+ calls this function unconditionally. |
| 20 | * |
| 21 | * @since 4.9.0 |
| 22 | * |
| 23 | * @return bool |
| 24 | */ |
| 25 | function wp_is_serving_rest_request() { |
| 26 | |
| 27 | return defined( 'REST_REQUEST' ) && REST_REQUEST; |
| 28 | } |
| 29 | } |
| 30 |