class.json-api-endpoints.php 1 location
|
@@ 1147-1149 (lines=3) @@
|
1144 |
|
); |
1145 |
|
} |
1146 |
|
|
1147 |
|
if ( strlen( $post->post_password ) && ! current_user_can( 'edit_post', $post->ID ) ) { |
1148 |
|
return new WP_Error( |
1149 |
|
'unauthorized', |
1150 |
|
'User cannot view password protected post', |
1151 |
|
array( |
1152 |
|
'status_code' => 403, |
sal/class.json-api-site-base.php 1 location
|
@@ 350-352 (lines=3) @@
|
347 |
|
return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) ); |
348 |
|
} |
349 |
|
|
350 |
|
if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) { |
351 |
|
return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) ); |
352 |
|
} |
353 |
|
|
354 |
|
return true; |
355 |
|
} |