diff options
Diffstat (limited to 'plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-get-post-backup-endpoint.php')
-rw-r--r-- | plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-get-post-backup-endpoint.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-get-post-backup-endpoint.php b/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-get-post-backup-endpoint.php index c9277cd4..903a16ac 100644 --- a/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-get-post-backup-endpoint.php +++ b/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-get-post-backup-endpoint.php @@ -3,12 +3,12 @@ class Jetpack_JSON_API_Get_Post_Backup_Endpoint extends Jetpack_JSON_API_Endpoint { // /sites/%s/posts/%d/backup -> $blog_id, $post_id - protected $needed_capabilities = array(); + protected $needed_capabilities = array(); // This endpoint is only accessible using a site token protected $post_id; function validate_input( $post_id ) { if ( empty( $post_id ) || ! is_numeric( $post_id ) ) { - return new WP_Error( 'post_id_not_specified', __( 'You must specify a Post ID', 'jetpack' ) ); + return new WP_Error( 'post_id_not_specified', __( 'You must specify a Post ID', 'jetpack' ), 400 ); } $this->post_id = intval( $post_id ); @@ -19,7 +19,7 @@ class Jetpack_JSON_API_Get_Post_Backup_Endpoint extends Jetpack_JSON_API_Endpoin protected function result() { $post = get_post( $this->post_id ); if ( empty( $post ) ) { - return new WP_Error( 'post_not_found', __( 'Post not found', 'jetpack' ) ); + return new WP_Error( 'post_not_found', __( 'Post not found', 'jetpack' ), 404 ); } return array( |