Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| Jetpack_JSON_API_Themes_List_Endpoint | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| validate_input | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName |
| 2 | |
| 3 | if ( ! defined( 'ABSPATH' ) ) { |
| 4 | exit( 0 ); |
| 5 | } |
| 6 | |
| 7 | /** |
| 8 | * Theme list endpoint class. |
| 9 | * |
| 10 | * GET /sites/%s/themes |
| 11 | * |
| 12 | * @phan-constructor-used-for-side-effects |
| 13 | */ |
| 14 | class Jetpack_JSON_API_Themes_List_Endpoint extends Jetpack_JSON_API_Themes_Endpoint { |
| 15 | /** |
| 16 | * Needed capabilities. |
| 17 | * |
| 18 | * @var string |
| 19 | */ |
| 20 | protected $needed_capabilities = 'switch_themes'; |
| 21 | |
| 22 | /** |
| 23 | * Validate the input. |
| 24 | * |
| 25 | * @param string $theme - the theme we're validating (unused, for keeping in sync with parent class). |
| 26 | * |
| 27 | * @return bool |
| 28 | */ |
| 29 | public function validate_input( $theme ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
| 30 | $this->themes = wp_get_themes( array( 'allowed' => true ) ); |
| 31 | return true; |
| 32 | } |
| 33 | } |