PluginProbe
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar / trunk
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar vtrunk
3.3.1 3.3.0 3.2.14 3.2.13 3.2.12 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 trunk 0.2.5.5 0.2.5.6 0.2.5.7 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.2.1 All 156 releases
← All changes | includes/Core/REST.php +8 -0 3.2.11trunk View file →
@@ -397,8 +397,14 @@
397 397 if( ! $request->has_param('type') ) {
398 398 return $this->error( 'type' );
399 399 }
400 400
401 + // Country targeting search is available for every notification type,
402 + // so route it by field regardless of the type/source.
403 + if ( ! empty( $params['field'] ) && $params['field'] === 'country_targeting' ) {
404 + return Targeting::restResponse( $request->get_json_params() );
405 + }
406 +
401 407 switch( $params['type'] ) {
402 408 case 'ContactForm' :
403 409 return ContactForm::restResponse( $request->get_json_params() );
404 410 break;
@@ -458,8 +464,9 @@
458 464 */
459 465 public function miscellaneous($request) {
460 466 $params = $request->get_params();
461 467
468 + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Reviewed for the NotificationX codebase: acceptable in this context.
462 469 $result = apply_filters('nx_rest_miscellaneous', null, $params);
463 470 if($result !== null){
464 471 return rest_ensure_response([
465 472 'success' => true,
@@ -489,8 +496,9 @@
489 496 return Helper::delete_server_cookies();
490 497 }
491 498
492 499 public function rest_data($nonce = true){
500 + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Reviewed for the NotificationX codebase: acceptable in this context.
493 501 return apply_filters('nx_rest_data', array(
494 502 'root' => rest_url(),
495 503 'namespace' => $this->_namespace(),
496 504 'nonce' => $nonce ? wp_create_nonce( 'wp_rest' ) : '',