Allow for separate headers upon conditional

This commit is contained in:
pblasquez
2016-04-28 14:36:25 -07:00
parent ee8268bf07
commit 186426933d

View File

@@ -11,9 +11,9 @@
* option) any later version. Please see LICENSE.txt at the top level of * option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details. * the source code distribution for details.
*/ */
header('Content-type: application/json');
if (is_admin() === false) { if (is_admin() === false) {
header('Content-type: text/plain');
die('ERROR: You need to be admin'); die('ERROR: You need to be admin');
} }
@@ -100,4 +100,5 @@ $response = array(
'status' => $status, 'status' => $status,
'message' => $message, 'message' => $message,
); );
header('Content-type: application/json');
echo _json_encode($response); echo _json_encode($response);