← All changes
|
modules/related-posts/class.related-posts-customize.php
+10
-9
13.5.2
→
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 | /** |
| @@ -66,22 +67,22 @@ | ||
| 66 | 67 | $selective_options[] = $control_id; |
| 67 | 68 | $wp_customize->add_setting( |
| 68 | 69 | $control_id, |
| 69 | 70 | array( |
| 70 | - 'default' => isset( $field['default'] ) ? $field['default'] : '', | |
| 71 | - 'type' => isset( $field['setting_type'] ) ? $field['setting_type'] : 'option', | |
| 72 | - 'capability' => isset( $field['capability'] ) ? $field['capability'] : 'edit_theme_options', | |
| 73 | - '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', | |
| 74 | 75 | ) |
| 75 | 76 | ); |
| 76 | 77 | $control_settings = array( |
| 77 | - 'label' => isset( $field['label'] ) ? $field['label'] : '', | |
| 78 | - 'description' => isset( $field['description'] ) ? $field['description'] : '', | |
| 78 | + 'label' => $field['label'] ?? '', | |
| 79 | + 'description' => $field['description'] ?? '', | |
| 79 | 80 | 'settings' => $control_id, |
| 80 | - 'type' => isset( $field['control_type'] ) ? $field['control_type'] : 'text', | |
| 81 | + 'type' => $field['control_type'] ?? 'text', | |
| 81 | 82 | 'section' => $this->prefix, |
| 82 | 83 | 'priority' => 10, |
| 83 | - 'active_callback' => isset( $field['active_callback'] ) ? $field['active_callback'] : __CLASS__ . '::is_single', | |
| 84 | + 'active_callback' => $field['active_callback'] ?? __CLASS__ . '::is_single', | |
| 84 | 85 | ); |
| 85 | 86 | switch ( $field['control_type'] ) { |
| 86 | 87 | case 'text': |
| 87 | 88 | case 'checkbox': |