Skip to content

Commit af9f622

Browse files
committed
get rid of trailing whitespace
1 parent 6e87124 commit af9f622

File tree

17 files changed

+248
-248
lines changed

17 files changed

+248
-248
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ language: php
77
# Versions of PHP to test against
88
php:
99
- 5.5
10-
10+
1111
# Specify versions of WordPress to test against
1212
# WP_VERSION = WordPress version number (use "master" for SVN trunk)
1313
# WP_MULTISITE = whether to test multisite (use either "0" or "1")

controllers/core.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
class JSON_API_Core_Controller {
8-
8+
99
public function info() {
1010
global $json_api;
1111
$php = '';
@@ -35,13 +35,13 @@ public function info() {
3535
);
3636
}
3737
}
38-
38+
3939
public function get_recent_posts() {
4040
global $json_api;
4141
$posts = $json_api->introspector->get_posts();
4242
return $this->posts_result($posts);
4343
}
44-
44+
4545
public function get_posts() {
4646
global $json_api;
4747
$url = parse_url($_SERVER['REQUEST_URI']);
@@ -57,7 +57,7 @@ public function get_posts() {
5757
$result['query'] = $query;
5858
return $result;
5959
}
60-
60+
6161
public function get_post() {
6262
global $json_api, $post;
6363
$post = $json_api->introspector->get_current_post();
@@ -99,7 +99,7 @@ public function get_page() {
9999
} else {
100100
$json_api->error("Include 'id' or 'slug' var in your request.");
101101
}
102-
102+
103103
// Workaround for https://core.trac.wordpress.org/ticket/12647
104104
if (empty($posts)) {
105105
$url = $_SERVER['REQUEST_URI'];
@@ -114,7 +114,7 @@ public function get_page() {
114114
}
115115
$posts = $json_api->introspector->get_posts(array('pagename' => $path));
116116
}
117-
117+
118118
if (count($posts) == 1) {
119119
if (!empty($children)) {
120120
$json_api->introspector->attach_child_posts($posts[0]);
@@ -126,7 +126,7 @@ public function get_page() {
126126
$json_api->error("Not found.");
127127
}
128128
}
129-
129+
130130
public function get_date_posts() {
131131
global $json_api;
132132
if ($json_api->query->date) {
@@ -147,7 +147,7 @@ public function get_date_posts() {
147147
}
148148
return $this->posts_result($posts);
149149
}
150-
150+
151151
public function get_category_posts() {
152152
global $json_api;
153153
$category = $json_api->introspector->get_current_category();
@@ -159,7 +159,7 @@ public function get_category_posts() {
159159
));
160160
return $this->posts_object_result($posts, $category);
161161
}
162-
162+
163163
public function get_tag_posts() {
164164
global $json_api;
165165
$tag = $json_api->introspector->get_current_tag();
@@ -171,7 +171,7 @@ public function get_tag_posts() {
171171
));
172172
return $this->posts_object_result($posts, $tag);
173173
}
174-
174+
175175
public function get_author_posts() {
176176
global $json_api;
177177
$author = $json_api->introspector->get_current_author();
@@ -183,7 +183,7 @@ public function get_author_posts() {
183183
));
184184
return $this->posts_object_result($posts, $author);
185185
}
186-
186+
187187
public function get_search_results() {
188188
global $json_api;
189189
if ($json_api->query->search) {
@@ -195,7 +195,7 @@ public function get_search_results() {
195195
}
196196
return $this->posts_result($posts);
197197
}
198-
198+
199199
public function get_date_index() {
200200
global $json_api;
201201
$permalinks = $json_api->introspector->get_date_archive_permalinks();
@@ -205,7 +205,7 @@ public function get_date_index() {
205205
'tree' => $tree
206206
);
207207
}
208-
208+
209209
public function get_category_index() {
210210
global $json_api;
211211
$args = null;
@@ -220,7 +220,7 @@ public function get_category_index() {
220220
'categories' => $categories
221221
);
222222
}
223-
223+
224224
public function get_tag_index() {
225225
global $json_api;
226226
$tags = $json_api->introspector->get_tags();
@@ -229,7 +229,7 @@ public function get_tag_index() {
229229
'tags' => $tags
230230
);
231231
}
232-
232+
233233
public function get_author_index() {
234234
global $json_api;
235235
$authors = $json_api->introspector->get_authors();
@@ -238,12 +238,12 @@ public function get_author_index() {
238238
'authors' => array_values($authors)
239239
);
240240
}
241-
241+
242242
public function get_page_index() {
243243
global $json_api;
244244
$pages = array();
245245
$post_type = $json_api->query->post_type ? $json_api->query->post_type : 'page';
246-
246+
247247
// Thanks to blinder for the fix!
248248
$numberposts = empty($json_api->query->count) ? -1 : $json_api->query->count;
249249
$wp_posts = get_posts(array(
@@ -263,7 +263,7 @@ public function get_page_index() {
263263
'pages' => $pages
264264
);
265265
}
266-
266+
267267
public function get_nonce() {
268268
global $json_api;
269269
extract($json_api->query->get(array('controller', 'method')));
@@ -286,7 +286,7 @@ public function get_nonce() {
286286
$json_api->error("Include 'controller' and 'method' vars in your request.");
287287
}
288288
}
289-
289+
290290
protected function get_object_posts($object, $id_var, $slug_var) {
291291
global $json_api;
292292
$object_id = "{$type}_id";
@@ -311,7 +311,7 @@ protected function get_object_posts($object, $id_var, $slug_var) {
311311
}
312312
return $posts;
313313
}
314-
314+
315315
protected function posts_result($posts) {
316316
global $wp_query;
317317
return array(
@@ -321,7 +321,7 @@ protected function posts_result($posts) {
321321
'posts' => $posts
322322
);
323323
}
324-
324+
325325
protected function posts_object_result($posts, $object) {
326326
global $wp_query;
327327
// Convert something like "JSON_API_Category" into "category"
@@ -333,7 +333,7 @@ protected function posts_object_result($posts, $object) {
333333
'posts' => $posts
334334
);
335335
}
336-
336+
337337
}
338338

339339
?>

controllers/posts.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function create_post() {
2828
'post' => $post
2929
);
3030
}
31-
31+
3232
public function update_post() {
3333
global $json_api;
3434
$post = $json_api->introspector->get_current_post();
@@ -52,7 +52,7 @@ public function update_post() {
5252
'post' => $post
5353
);
5454
}
55-
55+
5656
public function delete_post() {
5757
global $json_api;
5858
$post = $json_api->introspector->get_current_post();
@@ -79,7 +79,7 @@ public function delete_post() {
7979
wp_delete_post($post->ID);
8080
return array();
8181
}
82-
82+
8383
}
8484

8585
?>

controllers/respond.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
class JSON_API_Respond_Controller {
8-
8+
99
function submit_comment() {
1010
global $json_api;
1111
nocache_headers();
@@ -21,7 +21,7 @@ function submit_comment() {
2121
$pending = new JSON_API_Comment();
2222
return $pending->handle_submission();
2323
}
24-
24+
2525
}
2626

2727
?>

controllers/widgets.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
class JSON_API_Widgets_Controller {
8-
8+
99
function get_sidebar() {
1010
global $json_api;
1111
$index = @$_REQUEST['sidebar_id'];
@@ -14,7 +14,7 @@ function get_sidebar() {
1414
} else if (!is_active_sidebar($index)) {
1515
$json_api->error("Sidebar '$index' is not active.");
1616
}
17-
17+
1818
$widget_params = array(
1919
'before_widget',
2020
'after_widget',
@@ -27,9 +27,9 @@ function get_sidebar() {
2727
$json_api_params[$param] = $_REQUEST[$param];
2828
}
2929
}
30-
30+
3131
$widgets = array();
32-
32+
3333
global $wp_registered_sidebars, $wp_registered_widgets;
3434

3535
if ( is_int($index) ) {
@@ -43,25 +43,25 @@ function get_sidebar() {
4343
}
4444
}
4545
}
46-
46+
4747
$sidebars_widgets = wp_get_sidebars_widgets();
48-
48+
4949
if ( empty($wp_registered_sidebars[$index]) || !array_key_exists($index, $sidebars_widgets) || !is_array($sidebars_widgets[$index]) || empty($sidebars_widgets[$index]) )
5050
return false;
51-
51+
5252
$sidebar = $wp_registered_sidebars[$index];
53-
53+
5454
$did_one = false;
5555
foreach ( (array) $sidebars_widgets[$index] as $id ) {
56-
56+
5757
if ( !isset($wp_registered_widgets[$id]) ) continue;
58-
58+
5959
$params = array_merge(
6060
array( array_merge( $sidebar, array('widget_id' => $id, 'widget_name' => $wp_registered_widgets[$id]['name']), $json_api_params ) ),
6161
(array) $wp_registered_widgets[$id]['params']
6262
);
63-
64-
63+
64+
6565
// Substitute HTML id and class attributes into before_widget
6666
$classname_ = '';
6767
foreach ( (array) $wp_registered_widgets[$id]['classname'] as $cn ) {
@@ -72,13 +72,13 @@ function get_sidebar() {
7272
}
7373
$classname_ = ltrim($classname_, '_');
7474
$params[0]['before_widget'] = sprintf($params[0]['before_widget'], $id, $classname_);
75-
75+
7676
$params = apply_filters( 'dynamic_sidebar_params', $params );
77-
77+
7878
$callback = $wp_registered_widgets[$id]['callback'];
79-
79+
8080
do_action( 'dynamic_sidebar', $wp_registered_widgets[$id] );
81-
81+
8282
if ( is_callable($callback) ) {
8383
ob_start();
8484
$object = $callback[0];
@@ -96,13 +96,13 @@ function get_sidebar() {
9696
ob_end_clean();
9797
}
9898
}
99-
99+
100100
return array(
101101
'sidebar_id' => $index,
102102
'widgets' => $widgets
103103
);
104104
}
105-
105+
106106
}
107107

108108
?>

0 commit comments

Comments
 (0)