PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / src / Promotions / WelcomeBanner / WelcomeBanner.php

WelcomeBanner.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.9, at src/Promotions/WelcomeBanner/WelcomeBanner.php

57 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\Promotions\WelcomeBanner;
4
5 class WelcomeBanner
6 {
7 /**
8 * @since 3.0.0
9 */
10 public static function isShowing(): bool
11 {
12 global $pagenow;
13
14 $option = get_option('givewp_welcome_banner_dismiss');
15
16 return $pagenow === 'plugins.php' && !$option;
17 }
18
19 /**
20 * @since 3.0.0
21 */
22 public function render(): void
23 {
24 echo '<div id="givewp-welcome-banner"></div>';
25 }
26
27 /**
28 * @since 3.0.0
29 */
30 public function loadScripts(): void
31 {
32 wp_enqueue_script(
33 'givewp-welcome-banner',
34 GIVE_PLUGIN_URL . 'build/assets/dist/js/welcome-banner.js',
35 [],
36 GIVE_VERSION,
37 true
38 );
39
40 wp_localize_script(
41 'givewp-welcome-banner',
42 'WelcomeBanner',
43 [
44 'root' => esc_url_raw(rest_url('give-api/v2/welcome-banner')),
45 'nonce' => wp_create_nonce('wp_rest'),
46 'action' => 'givewp_welcome_banner_dismiss',
47 'assets' => GIVE_PLUGIN_URL . 'build/assets/dist/images/admin/promotions/welcome-banner',
48 ]
49 );
50
51 wp_set_script_translations( 'givewp-welcome-banner', 'give' );
52
53 wp_enqueue_style('givewp-design-system-foundation');
54 wp_enqueue_style('givewp-admin-fonts');
55 }
56 }
57