Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 13 |
Lines | 3 |
Ratio | 16.67 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | public static function handle_request( \WP_REST_Request $request) { |
||
|
|||
25 | $cap = \EE_Restriction_Generator_Base::get_default_restrictions_cap(); |
||
26 | if( \EE_Capabilities::instance()->current_user_can( $cap, 'read_over_api' ) ){ |
||
27 | return \EE_Config::instance(); |
||
28 | View Code Duplication | }else{ |
|
29 | return new \WP_Error( |
||
30 | 'cannot_read_config', |
||
31 | sprintf( |
||
32 | __( |
||
33 | 'You do not have the necessary capabilities (%s) to read Event Espresso Configuration data', |
||
34 | 'event_espresso' |
||
35 | ), |
||
36 | $cap |
||
37 | ), |
||
38 | array( 'status' => 403 ) |
||
39 | ); |
||
40 | } |
||
41 | } |
||
42 | } |
||
44 | // End of file Read.php |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.