PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.1
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.1
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 13.9.2 14.0.1 All 504 releases
← All changes | modules/related-posts/class.related-posts-customize.php +14 -12 12.2.3 → 16.3-a.1 View file →
@@ -3,9 +3,9 @@
3 3 use Automattic\Jetpack\Assets;
4 4
5 5 // Exit if file is accessed directly.
6 6 if ( ! defined( 'ABSPATH' ) ) {
7 - exit;
7 + exit( 0 );
8 8 }
9 9
10 10 /**
11 11 * Class to include elements to modify Related Posts look in Customizer.
@@ -10,8 +10,9 @@
10 10 /**
11 11 * Class to include elements to modify Related Posts look in Customizer.
12 12 *
13 13 * @since 4.4.0
14 + * @phan-constructor-used-for-side-effects
14 15 */
15 16 class Jetpack_Related_Posts_Customize {
16 17
17 18 /**
@@ -33,10 +34,12 @@
33 34 *
34 35 * @since 4.4.0
35 36 */
36 37 public function __construct() {
37 - add_action( 'customize_register', array( $this, 'customize_register' ) );
38 - add_action( 'customize_controls_enqueue_scripts', array( $this, 'customize_controls_enqueue_scripts' ) );
38 + if ( ! wp_is_block_theme() ) {
39 + add_action( 'customize_register', array( $this, 'customize_register' ) );
40 + add_action( 'customize_controls_enqueue_scripts', array( $this, 'customize_controls_enqueue_scripts' ) );
41 + }
39 42 }
40 43
41 44 /**
42 45 * Initialize Customizer controls.
@@ -64,22 +67,22 @@
64 67 $selective_options[] = $control_id;
65 68 $wp_customize->add_setting(
66 69 $control_id,
67 70 array(
68 - 'default' => isset( $field['default'] ) ? $field['default'] : '',
69 - 'type' => isset( $field['setting_type'] ) ? $field['setting_type'] : 'option',
70 - 'capability' => isset( $field['capability'] ) ? $field['capability'] : 'edit_theme_options',
71 - 'transport' => isset( $field['transport'] ) ? $field['transport'] : 'postMessage',
71 + 'default' => $field['default'] ?? '',
72 + 'type' => $field['setting_type'] ?? 'option',
73 + 'capability' => $field['capability'] ?? 'edit_theme_options',
74 + 'transport' => $field['transport'] ?? 'postMessage',
72 75 )
73 76 );
74 77 $control_settings = array(
75 - 'label' => isset( $field['label'] ) ? $field['label'] : '',
76 - 'description' => isset( $field['description'] ) ? $field['description'] : '',
78 + 'label' => $field['label'] ?? '',
79 + 'description' => $field['description'] ?? '',
77 80 'settings' => $control_id,
78 - 'type' => isset( $field['control_type'] ) ? $field['control_type'] : 'text',
81 + 'type' => $field['control_type'] ?? 'text',
79 82 'section' => $this->prefix,
80 83 'priority' => 10,
81 - 'active_callback' => isset( $field['active_callback'] ) ? $field['active_callback'] : __CLASS__ . '::is_single',
84 + 'active_callback' => $field['active_callback'] ?? __CLASS__ . '::is_single',
82 85 );
83 86 switch ( $field['control_type'] ) {
84 87 case 'text':
85 88 case 'checkbox':
@@ -285,9 +288,8 @@
285 288 JETPACK__VERSION,
286 289 false
287 290 );
288 291 }
289 -
290 292 } // class end
291 293
292 294 /**
293 295 * Control that displays a message in Customizer.