Permalink
Browse files

return results to be json-encoded

  • Loading branch information...
1 parent 609cd2a commit a84f5c96a3b5719a8b44ba7f91c111551e992c8e @matzko committed Mar 17, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 includes/json-server-class.php
@@ -18,9 +18,16 @@ public function submitQuery( $args = null )
);
} else {
$results = $wp_lite_autosuggest->get_results_from_query( $args->{'query'}, get_object_vars( $args ) );
+ $json_response_wrap = array();
+ foreach( $results as $link ) {
+ $json_response_wrap[] = $link;
+ }
if ( is_wp_error( $results ) ) {
return $results;
} else {
+ return array(
+ 'results' => $json_response_wrap,
+ );
}
}

0 comments on commit a84f5c9

Please sign in to comment.