This repository was archived by the owner on Feb 1, 2019. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33Plugin Name: WordPress JSON API
44Plugin URI: https://github.com/cfpb/wp-json-api
55Description: A RESTful API for WordPress
6- Version: 1.1.4
6+ Version: 1.1.5
77Author: Dan Phiffer, Greg Boone
88*/
99
Original file line number Diff line number Diff line change @@ -272,12 +272,17 @@ function set_custom_fields_value() {
272272 $ keys = explode (', ' , $ json_api ->query ->custom_fields );
273273 }
274274 foreach ($ wp_custom_fields as $ key => $ value ) {
275+ if ( sizeof ( $ wp_custom_fields [$ key ] ) > 1 ) {
276+ $ field = $ wp_custom_fields [$ key ];
277+ } else {
278+ $ field = $ wp_custom_fields [$ key ][0 ];
279+ }
275280 if ($ json_api ->query ->custom_fields ) {
276281 if (in_array ($ key , $ keys )) {
277- $ this ->custom_fields ->$ key = $ wp_custom_fields [ $ key ] ;
282+ $ this ->custom_fields ->$ key = maybe_unserialize ( $ field ) ;
278283 }
279284 } else if (substr ($ key , 0 , 1 ) != '_ ' ) {
280- $ this ->custom_fields ->$ key = $ wp_custom_fields [ $ key ] ;
285+ $ this ->custom_fields ->$ key = maybe_unserialize ( $ field ) ;
281286 }
282287 }
283288 } else {
Original file line number Diff line number Diff line change 11<?php
2+ use \DateTime ;
23
34class JSON_API_Query {
45
56 // Default values
67 protected $ defaults = array (
7- 'date_format ' => ' Y-m-d H:i:s ' ,
8+ 'date_format ' => Datetime:: ISO8601 ,
89 'read_more ' => 'Read more '
910 );
1011
You can’t perform that action at this time.
0 commit comments