class.json-api-endpoints.php 1 location
|
@@ 1032-1034 (lines=3) @@
|
1029 |
|
return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) ); |
1030 |
|
} |
1031 |
|
|
1032 |
|
if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) { |
1033 |
|
return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) ); |
1034 |
|
} |
1035 |
|
|
1036 |
|
return true; |
1037 |
|
} |
sal/class.json-api-site-base.php 1 location
|
@@ 269-271 (lines=3) @@
|
266 |
|
return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) ); |
267 |
|
} |
268 |
|
|
269 |
|
if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) { |
270 |
|
return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) ); |
271 |
|
} |
272 |
|
|
273 |
|
return true; |
274 |
|
} |