PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 3.0.1
Defender Security – Malware Scanner, Login Security & Firewall v3.0.1
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / framework / component / response.php

response.php in Defender Security – Malware Scanner, Login Security & Firewall 3.0.1, at framework/component/response.php

26 lines 789 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Calotes\Component;
4
5 class Response {
6 /**
7 * We will need to have a standard of returning data, frontend will base on the return for handling behavior
8 * Behaviors:
9 * - message: Show a floating notice using this param as content
10 * - redirect: Redirect to the URL
11 * - interval: As second, if this is set, then we will reload the page in period of time, if we have this with redirect,
12 * then, redirect to the URL after period of time
13 * Data:
14 * - data: Contains the data that return to frontend, can be empty
15 *
16 * Response constructor.
17 *
18 * @param $is_success
19 * @param $data
20 *
21 * @throws \Exception
22 */
23 public function __construct( $is_success, $data ) {
24 return $is_success ? wp_send_json_success( $data ) : wp_send_json_error( $data );
25 }
26 }