PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.16
VikBooking Hotel Booking Engine & PMS v1.8.16
1.8.16 1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 All 37 releases
← All changes | admin/helpers/src/platform/detection.php +21 -0 1.6.6 → 1.8.16 View file →
@@ -51,8 +51,29 @@
51 51 return (static::$platform === 'joomla');
52 52 }
53 53
54 54 /**
55 + * Tells whether the current execution is made by the WordPress REST API framework.
56 + * Useful to tell, for example, if the Gutenberg preview is calling the REST endpoint.
57 + *
58 + * @return bool
59 + *
60 + * @since 1.16.7 (J) - 1.6.7 (WP)
61 + */
62 + public static function isWordPressRestApi()
63 + {
64 + $requestUri = JFactory::getApplication()->input->server->getString('REQUEST_URI', '');
65 +
66 + if (static::isWordPress()) {
67 + if (strpos($requestUri, trailingslashit(rest_get_url_prefix())) !== false || JUri::getInstance($requestUri)->hasVar('rest_route')) {
68 + return true;
69 + }
70 + }
71 +
72 + return false;
73 + }
74 +
75 + /**
55 76 * Detects the name of the platform on which we are running the software.
56 77 *
57 78 * @return void
58 79 */