PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3
Jetpack – WP Security, Backup, Speed, & Growth v16.3
16.3 16.3-beta 16.3-a.5 16.3-a.7 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 All 508 releases
← All changes | jetpack_vendor/automattic/jetpack-connection/src/class-connection-assets.php +18 -0 16.2 → 16.3 View file →
@@ -20,8 +20,26 @@
20 20 public static function configure() {
21 21 add_action( 'wp_loaded', array( __CLASS__, 'register_assets' ) );
22 22
23 23 add_filter( 'jetpack_admin_js_script_data', array( Initial_State::class, 'set_connection_script_data' ), 10, 1 );
24 + // Priority 20: set_connection_script_data() replaces the whole `connection` key at 10.
25 + add_filter( 'jetpack_admin_js_script_data', array( __CLASS__, 'add_script_data' ), 20 );
26 + }
27 +
28 + /**
29 + * Add the package's image base URL to the admin script data.
30 + *
31 + * Other plugins' bundles request the disconnect dialog's images from this copy, so never rename one.
32 + *
33 + * @since 9.3.0
34 + *
35 + * @param array $data Script data.
36 + * @return array
37 + */
38 + public static function add_script_data( $data ) {
39 + $data['connection']['assetsUrl'] = trailingslashit( plugins_url( 'assets/images/', __DIR__ ) );
40 +
41 + return $data;
24 42 }
25 43
26 44 /**
27 45 * Register assets.