Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Get rid of extra json_return() arguments

Since the errors are now sent through a different method we don't need
the success flag and message arguments in json_return()
  • Loading branch information...
commit e977561838cdb665b63424273b3181b5c0c6e579 1 parent d4aa5ad
@nb nb authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 liveblog.php
View
12 liveblog.php
@@ -100,7 +100,7 @@ function ajax_entries_between() {
$entries = self::$entries->get_between_timestamps( $start_timestamp, $end_timestamp );
if ( !$entries ) {
- self::json_return( true, '', array( 'entries' => array(), 'current_timestamp' => $current_timestamp, 'latest_timestamp' => null ) );
+ self::json_return( array( 'entries' => array(), 'current_timestamp' => $current_timestamp, 'latest_timestamp' => null ) );
}
$latest_timestamp = 0;
@@ -117,7 +117,7 @@ function ajax_entries_between() {
'latest_timestamp' => $latest_timestamp,
);
- self::json_return( true, '', $result_for_json );
+ self::json_return( $result_for_json );
}
function is_viewing_liveblog_post() {
@@ -184,7 +184,7 @@ function ajax_insert_entry() {
// do not send latest_timestamp, because if we send it the client won't try to get older entries, but since we now send only the inserted
// one we don't know if there weren't any entries in between
- self::json_return( true, '', array( 'entries' => array( $entry->for_json() ), 'current_timestamp' => time(), 'latest_timestamp' => null ) );
+ self::json_return( array( 'entries' => array( $entry->for_json() ), 'current_timestamp' => time(), 'latest_timestamp' => null ) );
}
function entry_output( $entry ) {
@@ -319,10 +319,10 @@ function ajax_check_nonce( $action = 'liveblog_nonce' ) {
}
}
- function json_return( $success, $message, $data = array() ) {
+ function json_return( $data ) {
$return = json_encode( array(
- 'status' => intval( $success ),
- 'message' => $message,
+ 'status' => 1,
+ 'message' => '',
'data' => $data,
) );
Please sign in to comment.
Something went wrong with that request. Please try again.