PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.5
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.5
16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 All 506 releases
← All changes | json-endpoints/jetpack/class.wpcom-json-api-get-option-endpoint.php +8 -2 13.8.3 → 16.3-a.5 View file →
@@ -1,10 +1,16 @@
1 1 <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
2 2
3 3 use Automattic\Jetpack\Sync\Defaults;
4 4
5 +if ( ! defined( 'ABSPATH' ) ) {
6 + exit( 0 );
7 +}
8 +
5 9 /**
6 10 * Get option endpoint.
11 + *
12 + * @phan-constructor-used-for-side-effects
7 13 */
8 14 class WPCOM_JSON_API_Get_Option_Endpoint extends Jetpack_JSON_API_Endpoint {
9 15 /**
10 16 * This endpoint allows authentication both via a blog and a user token.
@@ -48,13 +54,13 @@
48 54 * @return bool|WP_Error
49 55 */
50 56 public function validate_input( $object ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
51 57 $query_args = $this->query_args();
52 - $this->option_name = isset( $query_args['option_name'] ) ? $query_args['option_name'] : false;
58 + $this->option_name = $query_args['option_name'] ?? false;
53 59 if ( ! $this->option_name ) {
54 60 return new WP_Error( 'option_name_not_set', __( 'You must specify an option_name', 'jetpack' ) );
55 61 }
56 - $this->site_option = isset( $query_args['site_option'] ) ? $query_args['site_option'] : false;
62 + $this->site_option = $query_args['site_option'] ?? false;
57 63
58 64 /**
59 65 * Filter the list of options that are manageable via the JSON API.
60 66 *