PluginProbe
Hello Plus / 1.7.4
Hello Plus v1.7.4
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.6.0 1.6.1 1.6.2 1.7.0 1.7.1 1.7.2 1.7.3 All 30 releases
← All changes | modules/admin/components/scripts-controller.php +31 -0 1.2.01.7.4 View file →
@@ -39,8 +39,39 @@
39 39
40 40 wp_set_script_translations( $handle, 'hello-plus' );
41 41 }
42 42
43 + public function enqueue_whats_new_onboarding_scripts() {
44 + $screen = get_current_screen();
45 +
46 + if ( 'plugins' !== $screen->id ) {
47 + return;
48 + }
49 +
50 + $handle = 'helloplus-whats-new';
51 + $asset_path = HELLOPLUS_SCRIPTS_PATH . $handle . '.asset.php';
52 + $asset_url = HELLOPLUS_SCRIPTS_URL;
53 +
54 + if ( ! file_exists( $asset_path ) ) {
55 + throw new \Exception( 'You need to run `npm run build` for the "hello-plus" first.' );
56 + }
57 +
58 + $script_asset = require $asset_path;
59 +
60 + $script_asset['dependencies'][] = 'wp-util';
61 +
62 + wp_enqueue_script(
63 + $handle,
64 + HELLOPLUS_SCRIPTS_URL . "$handle.js",
65 + $script_asset['dependencies'],
66 + $script_asset['version'],
67 + true
68 + );
69 +
70 + wp_set_script_translations( $handle, 'hello-plus' );
71 + }
72 +
43 73 public function __construct() {
44 74 add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_hello_plus_onboarding_scripts' ] );
75 + add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_whats_new_onboarding_scripts' ] );
45 76 }
46 77 }