Traits
1 month ago
CTF_About_Us.php
1 month ago
CTF_Admin_Notices.php
1 month ago
CTF_Cache_Handler.php
1 month ago
CTF_Global_Settings.php
1 month ago
CTF_HTTP_Request.php
1 month ago
CTF_New_User.php
1 month ago
CTF_Notifications.php
1 month ago
CTF_Response.php
1 month ago
CTF_Support.php
1 month ago
CTF_Upgrader.php
1 month ago
CTF_View.php
1 month ago
PluginSilentUpgrader.php
1 month ago
PluginSilentUpgraderSkin.php
1 month ago
SB_Twitter_Cache.php
1 month ago
addon-functions.php
1 month ago
class-install-skin.php
1 month ago
CTF_Response.php
26 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Class CTF_Response |
| 4 | * |
| 5 | * Sends back ajax response to client end |
| 6 | * |
| 7 | * @since 2.0 |
| 8 | */ |
| 9 | namespace TwitterFeed\Admin; |
| 10 | if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 11 | |
| 12 | class CTF_Response { |
| 13 | /** |
| 14 | * Response constructor. |
| 15 | * |
| 16 | * @param $is_success |
| 17 | * @param $data |
| 18 | * |
| 19 | * @throws \Exception |
| 20 | */ |
| 21 | public function __construct( $is_success, $data ) { |
| 22 | $is_success ? wp_send_json_success( $data ) : wp_send_json_error( $data ); |
| 23 | wp_die(); |
| 24 | } |
| 25 | } |
| 26 |