@@ -55,7 +55,7 @@ abstract class WPCOM_JSON_API_Endpoint {
55
55
56
56
// Is this endpoint still in testing phase? If so, not available to the public.
57
57
var $ in_testing = false ;
58
-
58
+
59
59
/**
60
60
* @var string Version of the API
61
61
*/
@@ -560,7 +560,7 @@ function document( $show_description = true ) {
560
560
561
561
<?php
562
562
// If no example was hardcoded in the doc, try to get some
563
- if ( empty ( $ this ->example_response ) ) {
563
+ if ( empty ( $ this ->example_response ) ) {
564
564
565
565
// Examples for endpoint documentation response
566
566
$ response_key = 'dev_response_ ' . $ this ->version . '_ ' . $ this ->method . '_ ' . sanitize_title ( $ this ->path );
@@ -1009,11 +1009,11 @@ function parse_date( $date_string ) {
1009
1009
1010
1010
$ gmt_offset = get_option ( 'gmt_offset ' );
1011
1011
$ local_time = $ time + $ gmt_offset * 3600 ;
1012
-
1012
+
1013
1013
$ date = getdate ( ( int ) $ local_time );
1014
1014
$ datetime ->setDate ( $ date ['year ' ], $ date ['mon ' ], $ date ['mday ' ] );
1015
1015
$ datetime ->setTime ( $ date ['hours ' ], $ date ['minutes ' ], $ date ['seconds ' ] );
1016
-
1016
+
1017
1017
$ local = $ datetime ->format ( 'Y-m-d H:i:s ' );
1018
1018
return array ( (string ) $ local , (string ) $ gmt );
1019
1019
}
@@ -1802,9 +1802,9 @@ function write_post( $path, $blog_id, $post_id ) {
1802
1802
}
1803
1803
1804
1804
unset( $ input ['tags ' ], $ input ['categories ' ] );
1805
-
1805
+
1806
1806
$ insert = array ();
1807
-
1807
+
1808
1808
if ( !empty ( $ input ['slug ' ] ) ) {
1809
1809
$ insert ['post_name ' ] = $ input ['slug ' ];
1810
1810
unset( $ input ['slug ' ] );
@@ -1814,22 +1814,22 @@ function write_post( $path, $blog_id, $post_id ) {
1814
1814
$ insert ['comment_status ' ] = 'open ' ;
1815
1815
else if ( false === $ input ['comments_open ' ] )
1816
1816
$ insert ['comment_status ' ] = 'closed ' ;
1817
-
1817
+
1818
1818
if ( true === $ input ['pings_open ' ] )
1819
1819
$ insert ['ping_status ' ] = 'open ' ;
1820
1820
else if ( false === $ input ['pings_open ' ] )
1821
1821
$ insert ['ping_status ' ] = 'closed ' ;
1822
-
1822
+
1823
1823
unset( $ input ['comments_open ' ], $ input ['pings_open ' ] );
1824
-
1824
+
1825
1825
$ publicize = $ input ['publicize ' ];
1826
1826
$ publicize_custom_message = $ input ['publicize_message ' ];
1827
1827
unset( $ input ['publicize ' ], $ input ['publicize_message ' ] );
1828
-
1828
+
1829
1829
foreach ( $ input as $ key => $ value ) {
1830
1830
$ insert ["post_ $ key " ] = $ value ;
1831
1831
}
1832
-
1832
+
1833
1833
$ has_media = isset ( $ input ['media ' ] ) && $ input ['media ' ] ? count ( $ input ['media ' ] ) : false ;
1834
1834
1835
1835
if ( $ new ) {
@@ -1870,7 +1870,7 @@ function write_post( $path, $blog_id, $post_id ) {
1870
1870
if ( !$ post_id || is_wp_error ( $ post_id ) ) {
1871
1871
return $ post_id ;
1872
1872
}
1873
-
1873
+
1874
1874
if ( $ publicize === false ) {
1875
1875
foreach ( $ GLOBALS ['publicize_ui ' ]->publicize ->get_services ( 'all ' ) as $ name => $ service ) {
1876
1876
update_post_meta ( $ post_id , $ GLOBALS ['publicize_ui ' ]->publicize ->POST_SKIP . $ name , 1 );
@@ -1882,10 +1882,10 @@ function write_post( $path, $blog_id, $post_id ) {
1882
1882
}
1883
1883
}
1884
1884
}
1885
-
1885
+
1886
1886
if ( !empty ( $ publicize_custom_message ) )
1887
- update_post_meta ( $ post_id , $ GLOBALS ['publicize_ui ' ]->publicize ->POST_MESS , trim ( $ publicize_custom_message ) );
1888
-
1887
+ update_post_meta ( $ post_id , $ GLOBALS ['publicize_ui ' ]->publicize ->POST_MESS , trim ( $ publicize_custom_message ) );
1888
+
1889
1889
if ( is_array ( $ categories ) )
1890
1890
wp_set_object_terms ( $ post_id , $ categories , 'category ' );
1891
1891
if ( is_array ( $ tags ) )
@@ -2048,7 +2048,7 @@ function new_taxonomy( $path, $blog_id, $taxonomy_type ) {
2048
2048
'parent ' => $ input ['parent ' ]
2049
2049
)
2050
2050
);
2051
-
2051
+
2052
2052
$ taxonomy = get_term_by ( 'id ' , $ data ['term_id ' ], $ taxonomy_type );
2053
2053
$ return = $ this ->get_taxonomy ( $ taxonomy ->slug , $ taxonomy_type , $ args ['context ' ] );
2054
2054
if ( !$ return || is_wp_error ( $ return ) ) {
@@ -2093,7 +2093,7 @@ function update_taxonomy( $path, $blog_id, $object_id, $taxonomy_type ) {
2093
2093
2094
2094
$ data = wp_update_term ( $ taxonomy ->term_id , $ taxonomy_type , $ update );
2095
2095
$ taxonomy = get_term_by ( 'id ' , $ data ['term_id ' ], $ taxonomy_type );
2096
-
2096
+
2097
2097
$ return = $ this ->get_taxonomy ( $ taxonomy ->slug , $ taxonomy_type , $ args ['context ' ] );
2098
2098
if ( !$ return || is_wp_error ( $ return ) ) {
2099
2099
return $ return ;
@@ -2713,7 +2713,7 @@ function update_comment( $path, $blog_id, $comment_id ) {
2713
2713
return new WP_Error ( 'trash_disabled ' , 'Cannot trash comment ' , 403 );
2714
2714
}
2715
2715
2716
- if ( 'trash ' !== $ comment_status ) {
2716
+ if ( 'trash ' !== $ comment_status ) {
2717
2717
wp_trash_comment ( $ comment_id );
2718
2718
}
2719
2719
break ;
@@ -3026,7 +3026,7 @@ function callback( $path = '', $blog_id = 0 ) {
3026
3026
'title ' => 'Hello World ' ,
3027
3027
'content ' => 'Hello. I am a test post. I was created by the API ' ,
3028
3028
'tags ' => 'tests ' ,
3029
- 'categories ' => 'API '
3029
+ 'categories ' => 'API '
3030
3030
)
3031
3031
),
3032
3032
@@ -3060,7 +3060,7 @@ function callback( $path = '', $blog_id = 0 ) {
3060
3060
"format": "standard",
3061
3061
"geo": false,
3062
3062
"publicize_URLs": [
3063
-
3063
+
3064
3064
],
3065
3065
"tags": {
3066
3066
"tests": {
@@ -3151,7 +3151,7 @@ function callback( $path = '', $blog_id = 0 ) {
3151
3151
'title ' => 'Hello World (Again) ' ,
3152
3152
'content ' => 'Hello. I am an edited post. I was edited by the API ' ,
3153
3153
'tags ' => 'tests ' ,
3154
- 'categories ' => 'API '
3154
+ 'categories ' => 'API '
3155
3155
)
3156
3156
),
3157
3157
@@ -3185,7 +3185,7 @@ function callback( $path = '', $blog_id = 0 ) {
3185
3185
"format": "standard",
3186
3186
"geo": false,
3187
3187
"publicize_URLs": [
3188
-
3188
+
3189
3189
],
3190
3190
"tags": {
3191
3191
"tests": {
@@ -3281,7 +3281,7 @@ function callback( $path = '', $blog_id = 0 ) {
3281
3281
"format": "standard",
3282
3282
"geo": false,
3283
3283
"publicize_URLs": [
3284
-
3284
+
3285
3285
],
3286
3286
"tags": {
3287
3287
"tests": {
0 commit comments