PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-beta
Jetpack – WP Security, Backup, Speed, & Growth v16.3-beta
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 13.7.2 All 507 releases
← All changes | jetpack_vendor/automattic/jetpack-licensing/src/class-licensing.php +31 -0 16.2-beta → 16.3-beta View file →
@@ -66,8 +66,39 @@
66 66 add_action( 'rest_api_init', array( $this, 'initialize_endpoints' ) );
67 67 }
68 68
69 69 /**
70 + * Register the hooks the package needs on every request.
71 + *
72 + * Separate from `initialize()`, which consumers call only when they offer the
73 + * licensing UI: the activation screen also renders from the Jetpack plugin's
74 + * own route, so the illustrations need a URL there too.
75 + *
76 + * @since 4.1.0
77 + *
78 + * @return void
79 + */
80 + public static function configure() {
81 + add_filter( 'jetpack_admin_js_script_data', array( self::class, 'add_script_data' ) );
82 + }
83 +
84 + /**
85 + * Add the package's image base URL to the admin script data.
86 + *
87 + * Other plugins' bundles request the activation screen's images from this copy, so never rename one.
88 + *
89 + * @since 4.1.0
90 + *
91 + * @param array $data Script data.
92 + * @return array
93 + */
94 + public static function add_script_data( $data ) {
95 + $data['licensing']['assetsUrl'] = trailingslashit( plugins_url( 'assets/images/', __DIR__ ) );
96 +
97 + return $data;
98 + }
99 +
100 + /**
70 101 * Initialize endpoints required for Licensing package.
71 102 *
72 103 * @since 1.7.0
73 104 *