| @@ -17,28 +17,20 @@ | ||
| 17 | 17 | // ===================================================================================================================== |
| 18 | 18 | // == Versions == |
| 19 | 19 | // ===================================================================================================================== |
| 20 | 20 | |
| 21 | -/** | |
| 22 | - * Check if this demo website | |
| 23 | - * | |
| 24 | - * @return bool | |
| 25 | - */ | |
| 26 | -function wpbc_is_this_demo() { | |
| 27 | - | |
| 28 | -// return true; //. | |
| 29 | - | |
| 30 | - if ( ! class_exists( 'wpdev_bk_personal' ) ) { | |
| 31 | - return false; // If this is Booking Calendar Free version, then it's not the demo. | |
| 32 | - } | |
| 33 | - | |
| 34 | - // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized | |
| 35 | - if ( ( ( isset( $_SERVER['SCRIPT_FILENAME'] ) ) && ( strpos( $_SERVER['SCRIPT_FILENAME'], 'wpbookingcalendar.com' ) !== false ) ) || ( ( isset( $_SERVER['HTTP_HOST'] ) ) && ( strpos( $_SERVER['HTTP_HOST'], 'wpbookingcalendar.com' ) !== false ) ) ) { | |
| 36 | - return true; | |
| 37 | - } else { | |
| 38 | - return false; | |
| 39 | - } | |
| 40 | -} | |
| 21 | +/** | |
| 22 | + * Check whether the site is a managed public Booking Calendar live demo. | |
| 23 | + * | |
| 24 | + * This compatibility helper delegates to the shared environment policy so | |
| 25 | + * legacy consumers and newer capability checks cannot classify the same host | |
| 26 | + * differently. | |
| 27 | + * | |
| 28 | + * @return bool True for a managed public live demo. | |
| 29 | + */ | |
| 30 | +function wpbc_is_this_demo() { | |
| 31 | + return WPBC_Environment_Policy::is_live_demo(); | |
| 32 | +} | |
| 41 | 33 | |
| 42 | 34 | |
| 43 | 35 | /** |
| 44 | 36 | * Determine whether the current request uses the local beta hostname. |