PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.8.1
GiveWP – Donation Plugin and Fundraising Platform v4.16.8.1
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 / Campaigns / CampaignsWelcomeBanner.php

CampaignsWelcomeBanner.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.8.1, at src/Promotions/Campaigns/CampaignsWelcomeBanner.php

69 lines 2.1 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\Campaigns;
4
5 namespace Give\Promotions\Campaigns;
6
7 use Give\Framework\Views\View;
8 use Give\Vendors\StellarWP\AdminNotices\AdminNotice;
9 use Give\Vendors\StellarWP\AdminNotices\AdminNotices;
10 use Give\Vendors\StellarWP\AdminNotices\DataTransferObjects\NoticeElementProperties;
11
12 /**
13 * @since 4.0.0
14 */
15 class CampaignsWelcomeBanner
16 {
17 /**
18 * @var string
19 */
20 public $id = 'givewp-campaigns-welcome-banner-2025';
21
22 /**
23 * @since 4.0.0
24 */
25 public function __invoke()
26 {
27 $this->render();
28 }
29
30 /**
31 * @since 4.0.0
32 */
33 public function render()
34 {
35 AdminNotices::show($this->id, [$this, 'renderCallback'])
36 ->custom()
37 ->location('below_header')
38 ->dismissible()
39 ->enqueueStylesheet(GIVE_PLUGIN_URL . 'build/campaignWelcomeBannerCss.css', [], '1.0.0')
40 ->enqueueScript(GIVE_PLUGIN_URL . 'build/campaignWelcomeBannerJs.js', [], '1.0.0')
41 ->on('plugins.php');
42 }
43
44 /**
45 * @since 4.0.0
46 */
47 public function renderCallback(AdminNotice $notice, NoticeElementProperties $elements): string
48 {
49 $backgroundUrl = GIVE_PLUGIN_URL . 'build/assets/dist/images/admin/promotions/campaigns/welcome-banner-background.svg';
50 $badgeIconUrl = GIVE_PLUGIN_URL . 'build/assets/dist/images/admin/promotions/campaigns/star-badge-icon.svg';
51 $heartIconUrl = GIVE_PLUGIN_URL . 'build/assets/dist/images/admin/promotions/campaigns/heart-icon.svg';
52 $exitIconUrl = GIVE_PLUGIN_URL . 'build/assets/dist/images/admin/promotions/campaigns/dismiss-icon.svg';
53 $campaignsPageUrl = admin_url('admin.php?page=give-campaigns');
54
55 return View::load(
56 'Promotions.CampaignWelcomeBanner',
57 [
58 'elements' => $elements,
59 'backgroundUrl' => $backgroundUrl,
60 'badgeIconUrl' => $badgeIconUrl,
61 'heartIconUrl' => $heartIconUrl,
62 'exitIconUrl' => $exitIconUrl,
63 'campaignsPageUrl' => $campaignsPageUrl,
64 ],
65 false
66 );
67 }
68 }
69