| @@ -5,9 +5,9 @@ | ||
| 5 | 5 | use Automattic\Jetpack\Redirect; |
| 6 | 6 | |
| 7 | 7 | // Disable direct access/execution to/of the widget code. |
| 8 | 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | - exit; | |
| 9 | + exit( 0 ); | |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * Jetpack_My_Community_Widget displays community members of this site. |
| @@ -43,12 +43,8 @@ | ||
| 43 | 43 | 'customize_selective_refresh' => true, |
| 44 | 44 | ) |
| 45 | 45 | ); |
| 46 | 46 | |
| 47 | - if ( is_active_widget( false, false, $this->id_base ) || is_active_widget( false, false, 'monster' ) || is_customize_preview() ) { | |
| 48 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_style' ) ); | |
| 49 | - } | |
| 50 | - | |
| 51 | 47 | $this->default_title = esc_html__( 'Community', 'jetpack' ); |
| 52 | 48 | |
| 53 | 49 | add_filter( 'widget_types_to_hide_from_legacy_widget_block', array( $this, 'hide_widget_in_block_editor' ) ); |
| 54 | 50 | } |
| @@ -81,9 +77,9 @@ | ||
| 81 | 77 | * |
| 82 | 78 | * @return string|void |
| 83 | 79 | */ |
| 84 | 80 | public function form( $instance ) { |
| 85 | - $title = isset( $instance['title'] ) ? $instance['title'] : false; | |
| 81 | + $title = $instance['title'] ?? false; | |
| 86 | 82 | if ( false === $title ) { |
| 87 | 83 | $title = $this->default_title; |
| 88 | 84 | } |
| 89 | 85 | |
| @@ -189,8 +185,11 @@ | ||
| 189 | 185 | |
| 190 | 186 | if ( false === $title ) { |
| 191 | 187 | $title = $this->default_title; |
| 192 | 188 | } |
| 189 | + | |
| 190 | + // Enqueue front end assets. | |
| 191 | + $this->enqueue_style(); | |
| 193 | 192 | |
| 194 | 193 | echo $args['before_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 195 | 194 | |
| 196 | 195 | /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ |