class.json-api-endpoints.php 1 location
|
@@ 1127-1129 (lines=3) @@
|
1124 |
|
); |
1125 |
|
} |
1126 |
|
|
1127 |
|
if ( strlen( $post->post_password ) && ! current_user_can( 'edit_post', $post->ID ) ) { |
1128 |
|
return new WP_Error( |
1129 |
|
'unauthorized', |
1130 |
|
'User cannot view password protected post', |
1131 |
|
array( |
1132 |
|
'status_code' => 403, |
sal/class.json-api-site-base.php 1 location
|
@@ 341-343 (lines=3) @@
|
338 |
|
return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) ); |
339 |
|
} |
340 |
|
|
341 |
|
if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) { |
342 |
|
return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) ); |
343 |
|
} |
344 |
|
|
345 |
|
return true; |
346 |
|
} |