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/widgets/google-translate.php +9 -9 12.0.3 → 16.3-a.1 View file →
@@ -1,10 +1,5 @@
1 1 <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
2 -
3 -// phpcs:disable Universal.Files.SeparateFunctionsFromOO.Mixed -- TODO: Move classes to appropriately-named class files.
4 -
5 -use Automattic\Jetpack\Assets;
6 -
7 2 /**
8 3 * Plugin Name: Google Translate Widget for WordPress.com
9 4 * Plugin URI: https://automattic.com
10 5 * Description: Add a widget for automatic translation
@@ -12,10 +7,15 @@
12 7 * Version: 0.1
13 8 * Author URI: https://automattic.com
14 9 * Text Domain: jetpack
15 10 */
11 +
12 +// phpcs:disable Universal.Files.SeparateFunctionsFromOO.Mixed -- TODO: Move classes to appropriately-named class files.
13 +
14 +use Automattic\Jetpack\Assets;
15 +
16 16 if ( ! defined( 'ABSPATH' ) ) {
17 - exit;
17 + exit( 0 );
18 18 }
19 19
20 20 /**
21 21 * Jetpack_Google_Translate_Widget main class.
@@ -148,9 +148,9 @@
148 148 'google-translate-init',
149 149 '_wp_google_translate_widget',
150 150 array(
151 151 'lang' => get_locale(),
152 - 'layout' => (int) $button_layout,
152 + 'layout' => $button_layout,
153 153 )
154 154 );
155 155 wp_enqueue_script( 'google-translate-init' );
156 156 wp_enqueue_script( 'google-translate' );
@@ -181,11 +181,12 @@
181 181 *
182 182 * @see WP_Widget::form()
183 183 *
184 184 * @param array $instance Previously saved values from database.
185 + * @return string|void
185 186 */
186 187 public function form( $instance ) {
187 - $title = isset( $instance['title'] ) ? $instance['title'] : false;
188 + $title = $instance['title'] ?? false;
188 189 if ( false === $title ) {
189 190 $title = $this->default_title;
190 191 }
191 192 ?>
@@ -213,9 +214,8 @@
213 214 $instance['title'] = false; // Store as false in case of language change.
214 215 }
215 216 return $instance;
216 217 }
217 -
218 218 }
219 219
220 220 /**
221 221 * Register the widget for use in Appearance -> Widgets.