PluginProbe ʕ •ᴥ•ʔ
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress / 3.1
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress v3.1
4.16.19 4.16.18 4.16.17 4.16.16 trunk 1.0 1.0.1 1.0.2 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.5a 1.1.6 1.1.7 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.4 1.4.1 1.4.2 1.5 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.7 1.7.1 1.7.2 1.8 1.8.1 1.8.10 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9 1.9.1 1.9.10 1.9.11 1.9.12 1.9.13 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.1.9 2.2.10 2.2.11 2.2.12 2.2.13 2.2.14 2.2.15 2.2.16 2.2.2 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 3.0 3.1 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 3.1.19 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.14 3.2.15 3.2.16 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 4.0.0 4.0.1 4.0.2 4.0.3 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.10.0 4.10.1 4.10.2 4.10.3 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.13.3 4.13.4 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.15.0 4.15.1 4.15.10 4.15.11 4.15.12 4.15.13 4.15.14 4.15.15 4.15.16 4.15.17 4.15.18 4.15.19 4.15.2 4.15.20 4.15.20.1 4.15.21 4.15.22 4.15.23 4.15.24 4.15.25 4.15.3 4.15.4 4.15.5 4.15.6 4.15.7 4.15.8 4.15.9 4.16.0 4.16.1 4.16.10 4.16.11 4.16.12 4.16.13 4.16.14 4.16.15 4.16.2 4.16.3 4.16.4 4.16.5 4.16.6 4.16.7 4.16.8 4.16.9 4.2.0 4.3.0 4.3.1 4.3.2 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.5.3 4.5.4 4.5.5 4.6.0 4.7.0 4.8.0 4.9.0
wp-user-avatar / src / Themes / DragDrop / ProfileFieldListing.php
wp-user-avatar / src / Themes / DragDrop Last commit date
EditProfile 5 years ago Login 5 years ago MemberDirectory 5 years ago PasswordReset 5 years ago Registration 5 years ago UserProfile 5 years ago AbstractBuildScratch.php 5 years ago AbstractMemberDirectoryTheme.php 5 years ago AbstractTheme.php 5 years ago FieldListing.php 5 years ago MemberDirectoryListing.php 5 years ago ProfileFieldListing.php 5 years ago ThemeInterface.php 5 years ago ThemesRepository.php 5 years ago index.php 5 years ago
ProfileFieldListing.php
169 lines
1 <?php
2
3 namespace ProfilePress\Core\Themes\DragDrop;
4
5 use ProfilePress\Core\Base;
6 use ProfilePress\Core\Classes\FormRepository as FR;
7 use ProfilePress\Core\Classes\PROFILEPRESS_sql;
8
9 class ProfileFieldListing
10 {
11 private $form_id;
12 private $field_settings = [];
13
14 private $has_field_data = false;
15
16 private $item_wrap_start_tag = '';
17 private $item_wrap_end_tag = '';
18 private $title_start_tag = '';
19 private $title_end_tag = '';
20 private $info_start_tag = '';
21 private $info_end_tag = '';
22
23 private $output = '';
24
25 private $defaults;
26
27 public function __construct($form_id)
28 {
29 $this->form_id = $form_id;
30
31 $this->field_settings = FR::form_builder_fields_settings($form_id, FR::USER_PROFILE_TYPE);
32 }
33
34 public function defaults($defaults)
35 {
36 $this->defaults = $defaults;
37
38 return $this;
39 }
40
41 public function item_wrap_start_tag($tag)
42 {
43 $this->item_wrap_start_tag = $tag;
44
45 return $this;
46 }
47
48 public function item_wrap_end_tag($tag)
49 {
50 $this->item_wrap_end_tag = $tag;
51
52 return $this;
53 }
54
55 public function title_start_tag($tag)
56 {
57 $this->title_start_tag = $tag;
58
59 return $this;
60 }
61
62 public function title_end_tag($tag)
63 {
64 $this->title_end_tag = $tag;
65
66 return $this;
67 }
68
69 public function info_start_tag($tag)
70 {
71 $this->info_start_tag = $tag;
72
73 return $this;
74 }
75
76 public function info_end_tag($tag)
77 {
78 $this->info_end_tag = $tag;
79
80 return $this;
81 }
82
83 public function has_field_data()
84 {
85 return $this->has_field_data;
86 }
87
88 public function forge()
89 {
90 $output = '';
91
92 foreach ($this->field_settings as $field_setting) {
93
94 $field_type = $field_setting['fieldType'];
95
96 if (isset($this->defaults, $this->defaults[$field_type])) {
97 $field_setting = wp_parse_args($field_setting, $this->defaults[$field_type]);
98 }
99
100 $field_title = isset($field_setting['label']) ? $field_setting['label'] : '';
101
102 if ($field_type == 'profile-cpf') {
103
104 $field_key = '';
105
106 if ( ! empty($field_setting['field_key']) && ! empty($field_setting['label'])) {
107 $field_key = $field_setting['field_key'];
108
109 $field_type = $field_type . ' key="' . $field_key . '"';
110
111 } elseif ( ! empty($field_setting['custom_field'])) {
112
113 $field_key = $field_setting['custom_field'];
114
115 $field_title = PROFILEPRESS_sql::get_field_label($field_key);
116
117 if ( ! $field_title) {
118 $field_title = PROFILEPRESS_sql::get_contact_info_field_label($field_key);
119 }
120
121 $field_type = $field_type . ' key="' . $field_key . '"';
122 }
123 }
124
125 if ($field_type == 'profile-display-name') {
126
127 if ( ! empty($field_setting['format'])) {
128
129 $field_type = $field_type . ' format="' . $field_setting['format'] . '"';
130 }
131 }
132
133 if ($field_type == 'pp-custom-html') {
134
135 if ( ! empty($field_setting['custom_html'])) {
136
137 $field_type = $field_type . ' custom_html="' . $field_setting['custom_html'] . '"';
138 }
139 }
140
141 $parsed_shortcode = do_shortcode('[' . $field_type . ']', true);
142
143 if ( ! empty($parsed_shortcode)) {
144
145 $this->has_field_data = true;
146
147 if ( ! empty($field_key) && strpos($field_type, 'profile-cpf') !== false && in_array($field_key, array_keys(ppress_social_network_fields()))) {
148 $parsed_shortcode = sprintf('<a href="%s">%s</a>', $parsed_shortcode, ppress_var(ppress_social_network_fields(), $field_key));
149 }
150
151 $output .= $this->item_wrap_start_tag;
152 if ( ! empty($field_title)) {
153 $output .= $this->title_start_tag . $field_title . $this->title_end_tag;
154 }
155 $output .= $this->info_start_tag . $parsed_shortcode . $this->info_end_tag;
156 $output .= $this->item_wrap_end_tag;
157 }
158 }
159
160 $this->output = $output;
161
162 return $this;
163 }
164
165 public function output()
166 {
167 return $this->output;
168 }
169 }