PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 2.9.4
GiveWP – Donation Plugin and Fundraising Platform v2.9.4
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 2.31.0 2.31.1 2.32.0 2.33.0 2.33.1 2.33.2 2.33.3 2.33.4 2.33.5 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.10.0 3.11.0 3.12.0 3.12.1 3.12.2 3.12.3 3.13.0 3.14.0 3.14.1 3.14.2 3.15.0 3.15.1 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.17.0 3.17.1 3.17.2 3.18.0 3.19.0 3.19.1 3.19.2 3.19.3 3.19.4 3.2.0 3.2.1 3.2.2 3.20.0 3.21.0 3.21.1 3.22.0 3.22.1 3.22.2 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.7.0 3.8.0 3.9.0 4.0.0 4.1.0 4.1.1 4.10.0 4.10.1 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.14.5 4.14.6 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.1 4.7.0 4.7.1 4.8.0 4.8.1 4.9.0 trunk 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.2 2.11.3 2.12.0 2.12.1 2.12.2 2.12.3 2.13.0 2.13.1 2.13.2 2.13.3 2.13.4 2.14.0 2.15.0 2.16.0 2.16.1 2.17.0 2.17.1 2.17.3 2.18.0 2.18.1 2.19.1 2.19.2 2.19.3 2.19.4 2.19.5 2.19.6 2.19.7 2.19.8 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.20.0 2.20.1 2.20.2 2.21.0 2.21.1 2.21.2 2.21.3 2.21.4 2.22.0 2.22.1 2.22.2 2.22.3 2.23.0 2.23.1 2.23.2 2.24.0 2.24.1 2.24.2 2.25.0 2.25.1 2.25.2 2.25.3 2.26.0 2.27.0 2.27.1 2.27.2 2.27.3 2.28.0 2.29.0 2.29.1 2.29.2
give / includes / admin / settings / class-settings-display.php
give / includes / admin / settings Last commit date
class-settings-addon.php 6 years ago class-settings-advanced.php 5 years ago class-settings-display.php 5 years ago class-settings-email.php 6 years ago class-settings-gateways.php 5 years ago class-settings-general.php 5 years ago class-settings-license.php 6 years ago
class-settings-display.php
350 lines
1 <?php
2 /**
3 * Give Settings Page/Tab
4 *
5 * @package Give
6 * @subpackage Classes/Give_Settings_Display
7 * @copyright Copyright (c) 2016, GiveWP
8 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 * @since 1.8
10 */
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 exit; // Exit if accessed directly
14 }
15
16 if ( ! class_exists( 'Give_Settings_Display' ) ) :
17
18 /**
19 * Give_Settings_Display.
20 *
21 * @sine 1.8
22 */
23 class Give_Settings_Display extends Give_Settings_Page {
24
25 /**
26 * Constructor.
27 */
28 public function __construct() {
29 $this->id = 'display';
30 $this->label = __( 'Default Options', 'give' );
31
32 $this->default_tab = 'display-settings';
33
34 parent::__construct();
35 }
36
37 /**
38 * Get settings array.
39 *
40 * @since 1.8
41 * @return array
42 */
43 public function get_settings() {
44 $settings = [];
45 $current_section = give_get_current_setting_section();
46
47 switch ( $current_section ) {
48 case 'display-settings':
49 $settings = [
50 // Section 1: Display
51 [
52 'id' => 'give_title_display_settings_1',
53 'type' => 'title',
54 ],
55 [
56 'name' => __( 'Name Title Prefix', 'give' ),
57 'desc' => __( 'Do you want a Name Title Prefix field to appear before First Name?', 'give' ),
58 'id' => 'name_title_prefix',
59 'type' => 'radio_inline',
60 'default' => 'disabled',
61 'options' => [
62 'disabled' => __( 'Disabled', 'give' ),
63 'required' => __( 'Required', 'give' ),
64 'optional' => __( 'Optional', 'give' ),
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-hidden give-title-prefixes-settings-wrap',
75 'style' => 'width: 30%',
76 'options' => give_get_default_title_prefixes(),
77 ],
78 [
79 'name' => __( 'Company Field', 'give' ),
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' ),
81 'id' => 'company_field',
82 'type' => 'radio_inline',
83 'default' => 'disabled',
84 'options' => [
85 'disabled' => __( 'Disabled', 'give' ),
86 'required' => __( 'Required', 'give' ),
87 'optional' => __( 'Optional', 'give' ),
88 ],
89 ],
90 [
91 'name' => __( 'Anonymous Donations', 'give' ),
92 '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' ),
93 'id' => 'anonymous_donation',
94 'type' => 'radio_inline',
95 'default' => 'disabled',
96 'options' => [
97 'enabled' => __( 'Enabled', 'give' ),
98 'disabled' => __( 'Disabled', 'give' ),
99 ],
100 ],
101 [
102 'name' => __( 'Donor Comments', 'give' ),
103 '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' ),
104 'id' => 'donor_comment',
105 'type' => 'radio_inline',
106 'default' => 'disabled',
107 'options' => [
108 'enabled' => __( 'Enabled', 'give' ),
109 'disabled' => __( 'Disabled', 'give' ),
110 ],
111 ],
112 [
113 'name' => __( 'Display Settings Docs Link', 'give' ),
114 'id' => 'display_settings_docs_link',
115 'url' => esc_url( 'http://docs.givewp.com/settings-form-options' ),
116 'title' => __( 'Display Options Settings', 'give' ),
117 'type' => 'give_docs_link',
118 ],
119 [
120 'id' => 'give_title_display_settings_1',
121 'type' => 'sectionend',
122 ],
123 ];
124 break;
125
126 case 'post-types':
127 $settings = [
128 [
129 'id' => 'give_title_display_settings_2',
130 'type' => 'title',
131 ],
132 [
133 'name' => __( 'Form Single Views', 'give' ),
134 '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' ),
135 'id' => 'forms_singular',
136 'type' => 'radio_inline',
137 'default' => 'enabled',
138 'options' => [
139 'enabled' => __( 'Enabled', 'give' ),
140 'disabled' => __( 'Disabled', 'give' ),
141 ],
142 ],
143 [
144 'name' => __( 'Form Archives', 'give' ),
145 'desc' => sprintf(
146 wp_kses(
147 __( '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' ),
148 [
149 'a' => [
150 'href' => [],
151 'target' => [],
152 ],
153 ]
154 ),
155 esc_url( admin_url( 'options-permalink.php' ) )
156 ),
157 'id' => 'forms_archives',
158 'type' => 'radio_inline',
159 'default' => 'enabled',
160 'options' => [
161 'enabled' => __( 'Enabled', 'give' ),
162 'disabled' => __( 'Disabled', 'give' ),
163 ],
164 ],
165 [
166 'name' => __( 'Form Excerpts', 'give' ),
167 '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' ),
168 'id' => 'forms_excerpt',
169 'type' => 'radio_inline',
170 'default' => 'enabled',
171 'options' => [
172 'enabled' => __( 'Enabled', 'give' ),
173 'disabled' => __( 'Disabled', 'give' ),
174 ],
175 ],
176 [
177 'name' => __( 'Form Featured Image', 'give' ),
178 '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' ),
179 'id' => 'form_featured_img',
180 'type' => 'radio_inline',
181 'default' => 'enabled',
182 'options' => [
183 'enabled' => __( 'Enabled', 'give' ),
184 'disabled' => __( 'Disabled', 'give' ),
185 ],
186 ],
187 [
188 'name' => __( 'Featured Image Size', 'give' ),
189 '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' ),
190 'id' => 'featured_image_size',
191 'type' => 'select',
192 'default' => 'large',
193 'options' => give_get_featured_image_sizes(),
194 ],
195 [
196 'name' => __( 'Single Form Sidebar', 'give' ),
197 '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' ),
198 'id' => 'form_sidebar',
199 'type' => 'radio_inline',
200 'default' => 'enabled',
201 'options' => [
202 'enabled' => __( 'Enabled', 'give' ),
203 'disabled' => __( 'Disabled', 'give' ),
204 ],
205 ],
206 [
207 'name' => __( 'Post Types Docs Link', 'give' ),
208 'id' => 'post_types_settings_docs_link',
209 'url' => esc_url( 'http://docs.givewp.com/settings-post-types' ),
210 'title' => __( 'Post Types Settings', 'give' ),
211 'type' => 'give_docs_link',
212 ],
213 [
214 'id' => 'give_title_display_settings_2',
215 'type' => 'sectionend',
216 ],
217 ];
218 break;
219
220 case 'taxonomies':
221 $settings = [
222 [
223 'id' => 'give_title_display_settings_3',
224 'type' => 'title',
225 ],
226 [
227 'name' => __( 'Form Categories', 'give' ),
228 'desc' => __( 'Enable Categories for all GiveWP forms.', 'give' ),
229 'id' => 'categories',
230 'type' => 'radio_inline',
231 'default' => 'disabled',
232 'options' => [
233 'enabled' => __( 'Enabled', 'give' ),
234 'disabled' => __( 'Disabled', 'give' ),
235 ],
236 ],
237 [
238 'name' => __( 'Form Tags', 'give' ),
239 'desc' => __( 'Enable Tags for all GiveWP forms.', 'give' ),
240 'id' => 'tags',
241 'type' => 'radio_inline',
242 'default' => 'disabled',
243 'options' => [
244 'enabled' => __( 'Enabled', 'give' ),
245 'disabled' => __( 'Disabled', 'give' ),
246 ],
247 ],
248 [
249 'name' => __( 'Taxonomies Docs Link', 'give' ),
250 'id' => 'taxonomies_settings_docs_link',
251 'url' => esc_url( 'http://docs.givewp.com/settings-taxonomies' ),
252 'title' => __( 'Taxonomies Settings', 'give' ),
253 'type' => 'give_docs_link',
254 ],
255 [
256 'id' => 'give_title_display_settings_3',
257 'type' => 'sectionend',
258 ],
259 ];
260 break;
261
262 case 'term-and-conditions':
263 $settings = [
264 [
265 'id' => 'give_title_display_settings_4',
266 'type' => 'title',
267 ],
268 [
269 'name' => __( 'Terms and Conditions', 'give' ),
270 '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' ),
271 'id' => 'terms',
272 'type' => 'radio_inline',
273 'default' => 'disabled',
274 'options' => [
275 'enabled' => __( 'Enabled', 'give' ),
276 'disabled' => __( 'Disabled', 'give' ),
277 ],
278 ],
279 [
280 'name' => __( 'Agree to Terms Label', 'give' ),
281 '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' ),
282 'id' => 'agree_to_terms_label',
283 'attributes' => [
284 'placeholder' => esc_attr__( 'Agree to Terms?', 'give' ),
285 'rows' => 1,
286 ],
287 'type' => 'textarea',
288 ],
289 [
290 'name' => __( 'Agreement Text', 'give' ),
291 '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' ),
292 'id' => 'agreement_text',
293 'type' => 'wysiwyg',
294 ],
295 [
296 'name' => __( 'Terms and Conditions Docs Link', 'give' ),
297 'id' => 'terms_settings_docs_link',
298 'url' => esc_url( 'http://docs.givewp.com/settings-terms' ),
299 'title' => __( 'Terms and Conditions Settings', 'give' ),
300 'type' => 'give_docs_link',
301 ],
302 [
303 'id' => 'give_title_display_settings_4',
304 'type' => 'sectionend',
305 ],
306 ];
307 break;
308 }
309
310 /**
311 * Filter the display options settings.
312 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
313 */
314 $settings = apply_filters( 'give_settings_display', $settings );
315
316 /**
317 * Filter the settings.
318 *
319 * @since 1.8
320 *
321 * @param array $settings
322 */
323 $settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
324
325 // Output.
326 return $settings;
327 }
328
329 /**
330 * Get sections.
331 *
332 * @since 1.8
333 * @return array
334 */
335 public function get_sections() {
336 $sections = [
337 'display-settings' => __( 'Form Fields', 'give' ),
338 'post-types' => __( 'Post Types', 'give' ),
339 'taxonomies' => __( 'Taxonomies', 'give' ),
340 'term-and-conditions' => __( 'Terms and Conditions', 'give' ),
341 ];
342
343 return apply_filters( 'give_get_sections_' . $this->id, $sections );
344 }
345 }
346
347 endif;
348
349 return new Give_Settings_Display();
350