| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName |
| 2 | 2 | |
| 3 | 3 | // phpcs:disable Universal.Files.SeparateFunctionsFromOO.Mixed -- TODO: Move classes to appropriately-named class files. |
| 4 | 4 | |
| 5 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 6 | + exit( 0 ); | |
| 7 | +} | |
| 8 | + | |
| 5 | 9 | add_action( 'widgets_init', 'jetpack_facebook_likebox_init' ); |
| 6 | 10 | /** |
| 7 | 11 | * Register the widget for use in Appearance -> Widgets |
| 8 | 12 | */ |
| @@ -107,12 +111,12 @@ | ||
| 107 | 111 | * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget. |
| 108 | 112 | * @param array $instance The settings for the particular instance of the widget. |
| 109 | 113 | */ |
| 110 | 114 | public function widget( $args, $instance ) { |
| 111 | - $before_widget = isset( $args['before_widget'] ) ? $args['before_widget'] : ''; | |
| 112 | - $before_title = isset( $args['before_title'] ) ? $args['before_title'] : ''; | |
| 113 | - $after_title = isset( $args['after_title'] ) ? $args['after_title'] : ''; | |
| 114 | - $after_widget = isset( $args['after_widget'] ) ? $args['after_widget'] : ''; | |
| 115 | + $before_widget = $args['before_widget'] ?? ''; | |
| 116 | + $before_title = $args['before_title'] ?? ''; | |
| 117 | + $after_title = $args['after_title'] ?? ''; | |
| 118 | + $after_widget = $args['after_widget'] ?? ''; | |
| 115 | 119 | $like_args = $this->get_default_args(); |
| 116 | 120 | |
| 117 | 121 | if ( isset( $instance['like_args'] ) ) { |
| 118 | 122 | $like_args = $this->normalize_facebook_args( $instance['like_args'] ); |
| @@ -237,8 +241,9 @@ | ||
| 237 | 241 | /** |
| 238 | 242 | * Outputs the widget settings form. |
| 239 | 243 | * |
| 240 | 244 | * @param array $instance Current settings. |
| 245 | + * @return string|void | |
| 241 | 246 | */ |
| 242 | 247 | public function form( $instance ) { |
| 243 | 248 | $instance = wp_parse_args( |
| 244 | 249 | (array) $instance, |