| @@ 309-332 (lines=24) @@ | ||
| 306 | * @return bool |
|
| 307 | * @throws DomainException |
|
| 308 | */ |
|
| 309 | public function verifyAssetIsRegistered($handle) |
|
| 310 | { |
|
| 311 | if (wp_script_is($handle, 'registered')) { |
|
| 312 | return true; |
|
| 313 | } |
|
| 314 | if (WP_DEBUG) { |
|
| 315 | throw new DomainException( |
|
| 316 | sprintf( |
|
| 317 | esc_html__( |
|
| 318 | 'The "%1$s" script is not registered when it should be!%2$s |
|
| 319 | Are you running the Barista plugin for development purposes? |
|
| 320 | If so, then you need to build the appropriate assets for this domain.%2$s |
|
| 321 | If you are seeing this error on a live website, then you should not have |
|
| 322 | the WP_DEBUG constant in your wp-config.php file set to "true". |
|
| 323 | Please contact Event Espresso support for more information.', |
|
| 324 | 'event_espresso' |
|
| 325 | ), |
|
| 326 | $handle, |
|
| 327 | '<br />' |
|
| 328 | ) |
|
| 329 | ); |
|
| 330 | } |
|
| 331 | return false; |
|
| 332 | } |
|
| 333 | ||
| 334 | ||
| 335 | /**************** deprecated ****************/ |
|
| @@ 82-103 (lines=22) @@ | ||
| 79 | * @return bool returns true if property is set, false if property is missing |
|
| 80 | * @throws DomainException throws exception if WP_DEBUG is true |
|
| 81 | */ |
|
| 82 | public function validateCriticalProperty($property, $type, $throw = true) |
|
| 83 | { |
|
| 84 | if (empty($property)) { |
|
| 85 | if (WP_DEBUG && $throw) { |
|
| 86 | throw new DomainException( |
|
| 87 | sprintf( |
|
| 88 | /* |
|
| 89 | * translators: |
|
| 90 | * 'The JsonDataNodeHandler domain route is a required property but has not been set.' |
|
| 91 | */ |
|
| 92 | esc_html__( |
|
| 93 | 'The JsonDataNodeHandler %1$s is a required property but has not been set.', |
|
| 94 | 'event_espresso' |
|
| 95 | ), |
|
| 96 | $type |
|
| 97 | ) |
|
| 98 | ); |
|
| 99 | } |
|
| 100 | return false; |
|
| 101 | } |
|
| 102 | return true; |
|
| 103 | } |
|
| 104 | } |
|
| 105 | ||