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 / DonorDashboards / Admin / SuccessNotice.php

SuccessNotice.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.9, at src/DonorDashboards/Admin/SuccessNotice.php

76 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\DonorDashboards\Admin;
4
5 class SuccessNotice
6 {
7
8 /**
9 * Reigster success notice
10 *
11 * @since 2.10.0
12 * @return void
13 *
14 */
15 public function register()
16 {
17 if ($this->shouldRenderOutput()) {
18 $this->renderOutput();
19 }
20 }
21
22 /**
23 * Return true if notice should be rendered, false if not
24 *
25 * @since 2.10.0
26 * @return boolean
27 *
28 */
29 protected function shouldRenderOutput()
30 {
31 return isset($_GET['give-generated-donor-dashboard-page']);
32 }
33
34 /**
35 * Render notice output
36 *
37 * @since 2.10.0
38 * @return void
39 *
40 */
41 protected function renderOutput()
42 {
43 echo $this->getOutput();
44 }
45
46 /**
47 * Get notice output
48 *
49 * @since 2.10.0
50 * @return string
51 *
52 */
53 protected function getOutput()
54 {
55 ob_start();
56 $output = '';
57 require $this->getTemplatePath();
58 $output = ob_get_contents();
59 ob_end_clean();
60
61 return $output;
62 }
63
64 /**
65 * Get template path for notice output
66 *
67 * @since 2.10.0
68 * @return string
69 *
70 */
71 protected function getTemplatePath()
72 {
73 return GIVE_PLUGIN_DIR . '/src/DonorDashboards/resources/views/successnotice.php';
74 }
75 }
76