Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function requireAuthForRestAccess($access) |
||
33 | { |
||
34 | if (!is_user_logged_in()) { |
||
35 | return new \WP_Error( |
||
36 | 'rest_cannot_access', |
||
37 | __('Only authenticated users can access the REST API.', 'wp-security'), |
||
38 | ['status' => rest_authorization_required_code()] |
||
39 | ); |
||
40 | } |
||
41 | |||
42 | return $access; |
||
43 | } |
||
45 |