PluginProbe ʕ •ᴥ•ʔ
Admin Columns / 7.1.4
Admin Columns v7.1.4
7.1.4 7.0.19 2.3.5 2.4 2.4.1 2.4.10 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.6.1 2.5.6.2 2.5.6.3 2.5.6.4 3.0 3.0.1 3.0.2 3.0.3 3.0.5 3.0.7 3.1 3.1.1 3.1.10 3.1.2 3.1.3 3.1.5 3.2.3 3.2.7 3.3.1 3.4.1 3.4.6 3.4.8 4.0.1 4.0.3 4.1.6 4.2.2 4.2.5 4.3 4.3.2 4.4.1 4.4.4 4.4.5 4.5.5 4.6.1 4.7.18 4.7.19 4.7.20 4.7.7 7.0.13 7.0.14 7.0.16 trunk 1.0 1.1 1.1.3 1.2 1.2.1 1.3 1.3.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.5.1 1.4.6 1.4.6.1 1.4.6.2 1.4.6.3 1.4.6.4 1.4.7 1.4.8 1.4.9 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2 2.2.1 2.2.1.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.5.1 2.2.6 2.2.6.1 2.2.6.2 2.2.6.3 2.2.6.4 2.2.7 2.2.8 2.2.8.1 2.2.9 2.3.1 2.3.2 2.3.3
codepress-admin-columns / classes / Admin / Banner / Context / Acf.php
codepress-admin-columns / classes / Admin / Banner / Context Last commit date
Acf.php 3 days ago WooCommerce.php 3 days ago
Acf.php
104 lines
1 <?php
2
3 declare(strict_types=1);
4
5 namespace AC\Admin\Banner\Context;
6
7 use AC;
8 use AC\Acf\FieldGroupCache;
9 use AC\Admin\Banner\BannerContext;
10 use AC\TableScreen;
11 use AC\Type\StartingPrice;
12 use AC\Type\Url\Site;
13 use AC\Type\Url\UtmTags;
14
15 class Acf implements BannerContext
16 {
17 private FieldGroupCache $field_group_cache;
18
19 public function __construct(FieldGroupCache $field_group_cache)
20 {
21 $this->field_group_cache = $field_group_cache;
22 }
23
24 public function is_active(TableScreen $table_screen): bool
25 {
26 if (! AC\Acf::is_active()) {
27 return false;
28 }
29
30 return $this->field_group_cache->get_count_for_table_screen($table_screen) > 0;
31 }
32
33 public function get_priority(): int
34 {
35 return 10;
36 }
37
38 public function get_arguments(TableScreen $table_screen): array
39 {
40 $upgrade_url = new UtmTags(new Site(Site::PAGE_ADDON_ACF), 'banner-acf');
41
42 $field_count = $this->field_group_cache->get_count_for_table_screen($table_screen);
43
44 return [
45 'badge' => __('Admin Columns Pro', 'codepress-admin-columns'),
46 'title' => _n(
47 'Your ACF field is hidden on this screen',
48 'Your ACF fields are hidden on this screen',
49 $field_count,
50 'codepress-admin-columns'
51 ),
52 'description' => sprintf(
53 _n(
54 '%d ACF field is not visible here. Pro turns it into a column you can sort, filter, edit, and export - no code needed.',
55 '%d ACF fields are not visible here. Pro turns each one into a column you can sort, filter, edit, and export - no code needed.',
56 $field_count,
57 'codepress-admin-columns'
58 ),
59 $field_count
60 ),
61 'quote' => [
62 'text' => __('A super intuitive life saver!', 'codepress-admin-columns'),
63 'cite' => __('Elliot Condon, creator of Advanced Custom Fields', 'codepress-admin-columns'),
64 ],
65 'features_label' => __('With Pro, your ACF fields become:', 'codepress-admin-columns'),
66 'features' => [
67 [
68 'url' => $upgrade_url->with_content('usp-acf-columns')->get_url(),
69 'label' => __('Visible as columns on this screen', 'codepress-admin-columns'),
70 ],
71 [
72 'url' => $upgrade_url->with_content('usp-acf-sorting')->get_url(),
73 'label' => __('Filterable and sortable by any field', 'codepress-admin-columns'),
74 ],
75 [
76 'url' => $upgrade_url->with_content('usp-acf-editing')->get_url(),
77 'label' => __('Editable directly in the table', 'codepress-admin-columns'),
78 ],
79 [
80 'url' => $upgrade_url->with_content('usp-acf-bulk-edit')->get_url(),
81 'label' => __('Bulk editable across hundreds of posts', 'codepress-admin-columns'),
82 ],
83 [
84 'url' => $upgrade_url->with_content('usp-acf-export')->get_url(),
85 'label' => __('Exportable to CSV', 'codepress-admin-columns'),
86 ],
87 ],
88 'upgrade_cta' => __('Unlock ACF fields in your table', 'codepress-admin-columns'),
89 'upgrade_cta_price' => sprintf(
90 '%s · %s',
91 sprintf(
92 /* translators: %s: price (e.g. $79) */
93 __('from %s/year', 'codepress-admin-columns'),
94 StartingPrice::get()
95 ),
96 __('all features included', 'codepress-admin-columns')
97 ),
98 'integrations' => [],
99 'promo_url' => $upgrade_url->get_url(),
100 ];
101 }
102
103 }
104