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 / DonationForms / AsyncData / AdminFormListView / AdminFormListView.php

AdminFormListView.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.8.1, at src/DonationForms/AsyncData/AdminFormListView/AdminFormListView.php

70 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\DonationForms\AsyncData\AdminFormListView;
4
5 use Give\DonationForms\AsyncData\AsyncDataHelpers;
6
7 /**
8 * @since 3.16.0
9 */
10 class AdminFormListView
11 {
12 /**
13 * @since 3.16.0
14 */
15 public function maybeChangeAchievedIconOpacity($achievedIconOpacity)
16 {
17 if (AdminFormListViewOptions::isGoalColumnAsync()) {
18 $achievedIconOpacity = 0;
19 }
20
21 return $achievedIconOpacity;
22 }
23
24 /**
25 * @since 3.16.0
26 */
27 public function maybeUsePlaceholderOnGoalAmountRaised(bool $usePlaceholder = false): bool
28 {
29 if (AdminFormListViewOptions::isGoalColumnAsync()) {
30 $usePlaceholder = true;
31 }
32
33 return $usePlaceholder;
34 }
35
36 /**
37 * @since 3.16.0
38 */
39 public function maybeSetDonationsColumnAsync($donationsCountCachedValue, $formId)
40 {
41 if (AdminFormListViewOptions::isDonationColumnAsync()) {
42 return AsyncDataHelpers::getSkeletonPlaceholder('1rem');
43 }
44
45 if (AdminFormListViewOptions::useCachedMetaKeys()) {
46 return $donationsCountCachedValue;
47 }
48
49 return AsyncDataHelpers::getFormDonationsCountValue($formId);
50 }
51
52 /**
53 * @since 3.16.0
54 */
55 public function maybeSetRevenueColumnAsync($revenueCachedValue, $formId)
56 {
57 if (AdminFormListViewOptions::isRevenueColumnAsync()) {
58 return AsyncDataHelpers::getSkeletonPlaceholder('1rem');
59 }
60
61 if (AdminFormListViewOptions::useCachedMetaKeys()) {
62 return $revenueCachedValue;
63 }
64
65 $revenue = AsyncDataHelpers::getFormRevenueValue($formId);
66
67 return give_currency_filter(give_format_amount($revenue));
68 }
69 }
70