PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.17.0
GiveWP – Donation Plugin and Fundraising Platform v4.17.0
4.17.0 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 All 256 releases
← All changes | includes/admin/settings/class-settings-display.php +136 -163 2.3.14.17.0 View file →
@@ -26,9 +26,9 @@
26 26 * Constructor.
27 27 */
28 28 public function __construct() {
29 29 $this->id = 'display';
30 - $this->label = __( 'Display Options', 'give' );
30 + $this->label = __( 'Default Options', 'give' );
31 31
32 32 $this->default_tab = 'display-settings';
33 33
34 34 parent::__construct();
@@ -40,190 +40,163 @@
40 40 * @since 1.8
41 41 * @return array
42 42 */
43 43 public function get_settings() {
44 - $settings = array();
44 + $settings = [];
45 45 $current_section = give_get_current_setting_section();
46 46
47 47 switch ( $current_section ) {
48 - case 'display-settings' :
49 - $settings = array(
48 + case 'display-settings':
49 + $settings = [
50 50 // Section 1: Display
51 - array(
51 + [
52 52 'id' => 'give_title_display_settings_1',
53 53 'type' => 'title',
54 - ),
55 - array(
56 - 'name' => __( 'Default Give Styles', 'give' ),
57 - 'desc' => __( 'You can disable Give\'s default styles for donation forms and other frontend elements.', 'give' ),
58 - 'id' => 'css',
59 - 'type' => 'radio_inline',
60 - 'default' => 'enabled',
61 - 'options' => array(
62 - 'enabled' => __( 'Enabled', 'give' ),
63 - 'disabled' => __( 'Disabled', 'give' ),
64 - ),
65 - ),
66 - array(
67 - 'name' => __( 'Floating Labels', 'give' ),
68 - /* translators: %s: http://docs.givewp.com/form-floating-labels */
69 - 'desc' => sprintf( wp_kses( __( '<a href="%s" target="_blank">Floating labels</a> allows your labels to be inset within the form fields to provide a cleaner form appearance. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give' ), array(
70 - 'a' => array(
71 - 'href' => array(),
72 - 'target' => array(),
73 - ),
74 - ) ), esc_url( 'http://docs.givewp.com/form-floating-labels' ) ),
75 - 'id' => 'floatlabels',
76 - 'type' => 'radio_inline',
77 - 'default' => 'disabled',
78 - 'options' => array(
79 - 'enabled' => __( 'Enabled', 'give' ),
80 - 'disabled' => __( 'Disabled', 'give' ),
81 - ),
82 - ),
83 - array(
84 - 'name' => __( 'Welcome Screen', 'give' ),
85 - /* translators: %s: about page URL */
86 - 'desc' => sprintf( wp_kses( __( 'Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> that displays each time Give is activated or updated.', 'give' ), array(
87 - 'a' => array(
88 - 'href' => array(),
89 - 'target' => array(),
90 - ),
91 - ) ), esc_url( admin_url( 'index.php?page=give-about' ) ) ),
92 - 'id' => 'welcome',
93 - 'type' => 'radio_inline',
94 - 'default' => 'enabled',
95 - 'options' => array(
96 - 'enabled' => __( 'Enabled', 'give' ),
97 - 'disabled' => __( 'Disabled', 'give' ),
98 - ),
99 - ),
100 - array(
54 + ],
55 + [
101 56 'name' => __( 'Name Title Prefix', 'give' ),
102 57 'desc' => __( 'Do you want a Name Title Prefix field to appear before First Name?', 'give' ),
103 58 'id' => 'name_title_prefix',
104 59 'type' => 'radio_inline',
105 60 'default' => 'disabled',
106 - 'options' => array(
61 + 'options' => [
107 62 'disabled' => __( 'Disabled', 'give' ),
108 63 'required' => __( 'Required', 'give' ),
109 64 'optional' => __( 'Optional', 'give' ),
110 - ),
111 - ),
112 - array(
113 - 'name' => __( 'Title Prefixes', 'give' ),
114 - 'desc' => __( 'Add or remove salutations from the dropdown using the field above.', 'give' ),
115 - 'id' => 'title_prefixes',
116 - 'type' => 'chosen',
117 - 'data_type' => 'multiselect',
118 - 'wrapper_class' => 'give-hidden give-title-prefixes-settings-wrap',
119 - 'style' => 'width: 30%',
120 - 'options' => give_get_default_title_prefixes(),
121 - ),
122 - array(
65 + ],
66 + ],
67 + [
68 + 'name' => __( 'Title Prefixes', 'give' ),
69 + 'desc' => __( 'Add or remove salutations from the dropdown using the field above.', 'give' ),
70 + 'id' => 'title_prefixes',
71 + 'type' => 'chosen',
72 + 'data_type' => 'multiselect',
73 + 'allow-custom-values' => true,
74 + 'wrapper_class' => 'give-title-prefixes-settings-wrap',
75 + 'style' => 'width: 30%',
76 + 'options' => give_get_default_title_prefixes(),
77 + ],
78 + [
123 79 'name' => __( 'Company Field', 'give' ),
124 80 'desc' => __( 'Do you want a Company field to appear after First Name and Last Name fields on all donation forms? You can enable this option per form as well.', 'give' ),
125 81 'id' => 'company_field',
126 82 'type' => 'radio_inline',
127 83 'default' => 'disabled',
128 - 'options' => array(
84 + 'options' => [
129 85 'disabled' => __( 'Disabled', 'give' ),
130 86 'required' => __( 'Required', 'give' ),
131 87 'optional' => __( 'Optional', 'give' ),
132 - ),
133 - ),
134 - array(
88 + ],
89 + ],
90 + [
91 + 'name' => __( 'Last Name Field Required', 'give' ),
92 + 'desc' => __( 'Do you want to require donor last names/surnames? By default, only the first name field on a donation is required. This setting is also configurable on a per-form basis.', 'give' ),
93 + 'id' => 'last_name_field_required',
94 + 'type' => 'radio_inline',
95 + 'default' => 'optional',
96 + 'options' => [
97 + 'required' => __( 'Required', 'give' ),
98 + 'optional' => __( 'Optional', 'give' ),
99 + ],
100 + ],
101 + [
135 102 'name' => __( 'Anonymous Donations', 'give' ),
136 - 'desc' => __( 'Do you want to provide donors the ability mark themselves anonymous while giving. This will prevent their information from appearing publicly on your website but you will still receive their information for your records in the admin panel.', 'give' ),
103 + 'desc' => __( 'Do you want to provide donors the ability mark themselves anonymous while giving? This will prevent their information from appearing publicly on your website but you will still receive their information for your records in the admin panel.', 'give' ),
137 104 'id' => 'anonymous_donation',
138 105 'type' => 'radio_inline',
139 106 'default' => 'disabled',
140 - 'options' => array(
107 + 'options' => [
141 108 'enabled' => __( 'Enabled', 'give' ),
142 109 'disabled' => __( 'Disabled', 'give' ),
143 - ),
144 - ),
145 - array(
110 + ],
111 + ],
112 + [
146 113 'name' => __( 'Donor Comments', 'give' ),
147 114 'desc' => __( 'Do you want to provide donors the ability to add a comment to their donation? The comment will display publicly on the donor wall if they do not select to give anonymously.', 'give' ),
148 115 'id' => 'donor_comment',
149 116 'type' => 'radio_inline',
150 117 'default' => 'disabled',
151 - 'options' => array(
118 + 'options' => [
152 119 'enabled' => __( 'Enabled', 'give' ),
153 120 'disabled' => __( 'Disabled', 'give' ),
154 - ),
155 - ),
156 - array(
121 + ],
122 + ],
123 + [
157 124 'name' => __( 'Display Settings Docs Link', 'give' ),
158 125 'id' => 'display_settings_docs_link',
159 - 'url' => esc_url( 'http://docs.givewp.com/form-display-options' ),
126 + 'url' => esc_url( 'http://docs.givewp.com/settings-form-options' ),
160 127 'title' => __( 'Display Options Settings', 'give' ),
161 128 'type' => 'give_docs_link',
162 - ),
163 - array(
129 + ],
130 + [
164 131 'id' => 'give_title_display_settings_1',
165 132 'type' => 'sectionend',
166 - ),
167 - );
133 + ],
134 + ];
168 135 break;
169 136
170 - case 'post-types' :
171 - $settings = array(
172 - array(
137 + case 'post-types':
138 + $settings = [
139 + [
173 140 'id' => 'give_title_display_settings_2',
174 141 'type' => 'title',
175 - ),
176 - array(
142 + ],
143 + [
177 144 'name' => __( 'Form Single Views', 'give' ),
178 - 'desc' => __( 'By default, all donation form have single views enabled which creates a specific URL on your website for that form. This option disables the singular posts from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ),
145 + 'desc' => __( 'By default, all donation forms have single views enabled. This creates a specific URL on your website for that form. Selecting "Disabled" will prevent the single view from being publicly displayed. Note: if selecting "Disabled", to display each form you will need to embed it using a block, shortcode, or widget.', 'give' ),
179 146 'id' => 'forms_singular',
180 147 'type' => 'radio_inline',
181 148 'default' => 'enabled',
182 - 'options' => array(
149 + 'options' => [
183 150 'enabled' => __( 'Enabled', 'give' ),
184 151 'disabled' => __( 'Disabled', 'give' ),
185 - ),
186 - ),
187 - array(
152 + ],
153 + ],
154 + [
188 155 'name' => __( 'Form Archives', 'give' ),
189 - 'desc' => sprintf( wp_kses( __( 'Archives pages list all the donation forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to <a href="%s">refresh your permalinks</a> after this option has been enabled.', 'give' ), array(
190 - 'a' => array(
191 - 'href' => array(),
192 - 'target' => array(),
156 + 'desc' => sprintf(
157 + wp_kses(
158 + __( 'Archive pages list all the donation forms you have created. This option will disable only the form\'s archive page(s). The form\'s single view will still be displayed. Note: you will need to <a href="%s">refresh your permalinks</a> after this option has been enabled.', 'give' ),
159 + [
160 + 'a' => [
161 + 'href' => [],
162 + 'target' => [],
163 + ],
164 + ]
193 165 ),
194 - ) ), esc_url( admin_url( 'options-permalink.php' ) ) ),
166 + esc_url( admin_url( 'options-permalink.php' ) )
167 + ),
195 168 'id' => 'forms_archives',
196 169 'type' => 'radio_inline',
197 170 'default' => 'enabled',
198 - 'options' => array(
171 + 'options' => [
199 172 'enabled' => __( 'Enabled', 'give' ),
200 173 'disabled' => __( 'Disabled', 'give' ),
201 - ),
202 - ),
203 - array(
174 + ],
175 + ],
176 + [
204 177 'name' => __( 'Form Excerpts', 'give' ),
205 178 'desc' => __( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ),
206 179 'id' => 'forms_excerpt',
207 180 'type' => 'radio_inline',
208 181 'default' => 'enabled',
209 - 'options' => array(
182 + 'options' => [
210 183 'enabled' => __( 'Enabled', 'give' ),
211 184 'disabled' => __( 'Disabled', 'give' ),
212 - ),
213 - ),
214 - array(
185 + ],
186 + ],
187 + [
215 188 'name' => __( 'Form Featured Image', 'give' ),
216 189 'desc' => __( 'If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give' ),
217 190 'id' => 'form_featured_img',
218 191 'type' => 'radio_inline',
219 192 'default' => 'enabled',
220 - 'options' => array(
193 + 'options' => [
221 194 'enabled' => __( 'Enabled', 'give' ),
222 195 'disabled' => __( 'Disabled', 'give' ),
223 - ),
224 - ),
225 - array(
196 + ],
197 + ],
198 + [
226 199 'name' => __( 'Featured Image Size', 'give' ),
227 200 'desc' => __( 'The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give' ),
228 201 'id' => 'featured_image_size',
229 202 'type' => 'select',
@@ -228,121 +201,121 @@
228 201 'id' => 'featured_image_size',
229 202 'type' => 'select',
230 203 'default' => 'large',
231 204 'options' => give_get_featured_image_sizes(),
232 - ),
233 - array(
205 + ],
206 + [
234 207 'name' => __( 'Single Form Sidebar', 'give' ),
235 - 'desc' => __( 'The sidebar allows you to add additional widgets to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ),
208 + 'desc' => __( 'The sidebar allows you to add additional widgets to the GiveWP single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ),
236 209 'id' => 'form_sidebar',
237 210 'type' => 'radio_inline',
238 211 'default' => 'enabled',
239 - 'options' => array(
212 + 'options' => [
240 213 'enabled' => __( 'Enabled', 'give' ),
241 214 'disabled' => __( 'Disabled', 'give' ),
242 - ),
243 - ),
244 - array(
215 + ],
216 + ],
217 + [
245 218 'name' => __( 'Post Types Docs Link', 'give' ),
246 219 'id' => 'post_types_settings_docs_link',
247 220 'url' => esc_url( 'http://docs.givewp.com/settings-post-types' ),
248 221 'title' => __( 'Post Types Settings', 'give' ),
249 222 'type' => 'give_docs_link',
250 - ),
251 - array(
223 + ],
224 + [
252 225 'id' => 'give_title_display_settings_2',
253 226 'type' => 'sectionend',
254 - ),
255 - );
227 + ],
228 + ];
256 229 break;
257 230
258 231 case 'taxonomies':
259 - $settings = array(
260 - array(
232 + $settings = [
233 + [
261 234 'id' => 'give_title_display_settings_3',
262 235 'type' => 'title',
263 - ),
264 - array(
236 + ],
237 + [
265 238 'name' => __( 'Form Categories', 'give' ),
266 - 'desc' => __( 'Enable Categories for all Give forms.', 'give' ),
239 + 'desc' => __( 'Enable Categories for all GiveWP forms.', 'give' ),
267 240 'id' => 'categories',
268 241 'type' => 'radio_inline',
269 242 'default' => 'disabled',
270 - 'options' => array(
243 + 'options' => [
271 244 'enabled' => __( 'Enabled', 'give' ),
272 245 'disabled' => __( 'Disabled', 'give' ),
273 - ),
274 - ),
275 - array(
246 + ],
247 + ],
248 + [
276 249 'name' => __( 'Form Tags', 'give' ),
277 - 'desc' => __( 'Enable Tags for all Give forms.', 'give' ),
250 + 'desc' => __( 'Enable Tags for all GiveWP forms.', 'give' ),
278 251 'id' => 'tags',
279 252 'type' => 'radio_inline',
280 253 'default' => 'disabled',
281 - 'options' => array(
254 + 'options' => [
282 255 'enabled' => __( 'Enabled', 'give' ),
283 256 'disabled' => __( 'Disabled', 'give' ),
284 - ),
285 - ),
286 - array(
257 + ],
258 + ],
259 + [
287 260 'name' => __( 'Taxonomies Docs Link', 'give' ),
288 261 'id' => 'taxonomies_settings_docs_link',
289 262 'url' => esc_url( 'http://docs.givewp.com/settings-taxonomies' ),
290 263 'title' => __( 'Taxonomies Settings', 'give' ),
291 264 'type' => 'give_docs_link',
292 - ),
293 - array(
265 + ],
266 + [
294 267 'id' => 'give_title_display_settings_3',
295 268 'type' => 'sectionend',
296 - ),
297 - );
269 + ],
270 + ];
298 271 break;
299 272
300 273 case 'term-and-conditions':
301 - $settings = array(
302 - array(
274 + $settings = [
275 + [
303 276 'id' => 'give_title_display_settings_4',
304 277 'type' => 'title',
305 - ),
306 - array(
278 + ],
279 + [
307 280 'name' => __( 'Terms and Conditions', 'give' ),
308 - 'desc' => __( 'Would you like donors to require that donors agree to your terms when donating? Note: You can enable/disable this option and customize the terms per form as well.', 'give' ),
281 + 'desc' => __( 'Would you like to require that donors agree to your terms when donating? Note: You can enable/disable this option and customize the terms per form as well.', 'give' ),
309 282 'id' => 'terms',
310 283 'type' => 'radio_inline',
311 284 'default' => 'disabled',
312 - 'options' => array(
285 + 'options' => [
313 286 'enabled' => __( 'Enabled', 'give' ),
314 287 'disabled' => __( 'Disabled', 'give' ),
315 - ),
316 - ),
317 - array(
288 + ],
289 + ],
290 + [
318 291 'name' => __( 'Agree to Terms Label', 'give' ),
319 292 'desc' => __( 'The label shown next to the agree to terms check box. Customize it here or leave blank to use the default placeholder text. Note: You can customize the label per form.', 'give' ),
320 293 'id' => 'agree_to_terms_label',
321 - 'attributes' => array(
294 + 'attributes' => [
322 295 'placeholder' => esc_attr__( 'Agree to Terms?', 'give' ),
323 - 'rows' => 1
324 - ),
296 + 'rows' => 1,
297 + ],
325 298 'type' => 'textarea',
326 - ),
327 - array(
299 + ],
300 + [
328 301 'name' => __( 'Agreement Text', 'give' ),
329 302 'desc' => __( 'This is the actual text which the user will be asked to agree to in order to donate. Note: You can customize the content per form as needed.', 'give' ),
330 303 'id' => 'agreement_text',
331 304 'type' => 'wysiwyg',
332 - ),
333 - array(
305 + ],
306 + [
334 307 'name' => __( 'Terms and Conditions Docs Link', 'give' ),
335 308 'id' => 'terms_settings_docs_link',
336 309 'url' => esc_url( 'http://docs.givewp.com/settings-terms' ),
337 310 'title' => __( 'Terms and Conditions Settings', 'give' ),
338 311 'type' => 'give_docs_link',
339 - ),
340 - array(
312 + ],
313 + [
341 314 'id' => 'give_title_display_settings_4',
342 315 'type' => 'sectionend',
343 - ),
344 - );
316 + ],
317 + ];
345 318 break;
346 319 }
347 320
348 321 /**
@@ -370,14 +343,14 @@
370 343 * @since 1.8
371 344 * @return array
372 345 */
373 346 public function get_sections() {
374 - $sections = array(
375 - 'display-settings' => __( 'Display', 'give' ),
347 + $sections = [
348 + 'display-settings' => __( 'Form Fields', 'give' ),
376 349 'post-types' => __( 'Post Types', 'give' ),
377 350 'taxonomies' => __( 'Taxonomies', 'give' ),
378 351 'term-and-conditions' => __( 'Terms and Conditions', 'give' ),
379 - );
352 + ];
380 353
381 354 return apply_filters( 'give_get_sections_' . $this->id, $sections );
382 355 }
383 356 }