PluginProbe
Code Snippets / trunk
Code Snippets vtrunk
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
← All changes | php/Admin/Menus/Welcome_Menu.php +25 -12 4.0.0-beta.1 → trunk View file →
@@ -1,9 +1,10 @@
1 1 <?php
2 2
3 3 namespace Code_Snippets\Admin\Menus;
4 4
5 -use Code_Snippets\Client\Welcome_API;
5 +use Code_Snippets\Admin\Contextual_Help;
6 +use Code_Snippets\Client\Welcome_Client;
6 7 use function Code_Snippets\code_snippets;
7 8 use const Code_Snippets\PLUGIN_FILE;
8 9 use const Code_Snippets\PLUGIN_VERSION;
9 10
@@ -15,20 +16,20 @@
15 16 */
16 17 class Welcome_Menu extends Admin_Menu {
17 18
18 19 /**
19 - * Instance of Welcome_API class.
20 + * Client instance.
20 21 *
21 - * @var Welcome_API
22 + * @var Welcome_Client
22 23 */
23 - protected Welcome_API $api;
24 + protected Welcome_Client $client;
24 25
25 26 /**
26 27 * Class constructor
27 28 *
28 - * @param Welcome_API $api Instance of API class.
29 + * @param Welcome_Client $client Client instance.
29 30 */
30 - public function __construct( $api ) {
31 + public function __construct( $client ) {
31 32 parent::__construct(
32 33 'welcome',
33 34 _x( "What's New", 'menu label', 'code-snippets' ),
34 35 __( 'Resources and Updates', 'code-snippets' )
@@ -33,9 +34,9 @@
33 34 _x( "What's New", 'menu label', 'code-snippets' ),
34 35 __( 'Resources and Updates', 'code-snippets' )
35 36 );
36 37
37 - $this->api = $api;
38 + $this->client = $client;
38 39 }
39 40
40 41 /**
41 42 * Load the welcome menu.
@@ -46,8 +47,20 @@
46 47 echo '<div id="code-snippets-welcome-container" class="wrap"></div>';
47 48 }
48 49
49 50 /**
51 + * Load the contextual help tabs.
52 + *
53 + * @return void
54 + */
55 + public function load() {
56 + parent::load();
57 +
58 + $contextual_help = new Contextual_Help( 'welcome' );
59 + $contextual_help->load();
60 + }
61 +
62 + /**
50 63 * Enqueue assets necessary for the welcome menu.
51 64 *
52 65 * @return void
53 66 */
@@ -74,13 +87,13 @@
74 87 wp_localize_script(
75 88 $handle,
76 89 'CODE_SNIPPETS_WELCOME',
77 90 [
78 - 'banner' => $this->api->get_banner(),
79 - 'hero' => $this->api->get_hero_item(),
80 - 'changelog' => $this->api->get_changelog(),
81 - 'features' => $this->api->get_features(),
82 - 'partners' => $this->api->get_partners(),
91 + 'banner' => $this->client->get_banner(),
92 + 'hero' => $this->client->get_hero_item(),
93 + 'changelog' => $this->client->get_changelog(),
94 + 'features' => $this->client->get_features(),
95 + 'partners' => $this->client->get_partners(),
83 96 ]
84 97 );
85 98 }
86 99 }