Skip to content

Commit ca90b15

Browse files
committed
Return Empty if empty
1 parent 44c8286 commit ca90b15

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function custom_api_get_all_posts_callback(WP_REST_Request $request)
136136

137137
// if no posts found return
138138
if (empty($query->posts)) {
139-
return new WP_Error('no_posts', __('No post found'), array('status' => 404));
139+
return array();
140140
}
141141

142142
// set max number of pages and total num of posts

0 commit comments

Comments
 (0)