@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Settings_Display' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Display')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Display. |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function __construct() { |
29 | 29 | $this->id = 'display'; |
30 | - $this->label = __( 'Display Options', 'give' ); |
|
30 | + $this->label = __('Display Options', 'give'); |
|
31 | 31 | |
32 | 32 | $this->default_tab = 'display-settings'; |
33 | 33 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $settings = array(); |
45 | 45 | $current_section = give_get_current_setting_section(); |
46 | 46 | |
47 | - switch ( $current_section ) { |
|
47 | + switch ($current_section) { |
|
48 | 48 | case 'display-settings' : |
49 | 49 | $settings = array( |
50 | 50 | // Section 1: Display |
@@ -53,67 +53,67 @@ discard block |
||
53 | 53 | 'type' => 'title', |
54 | 54 | ), |
55 | 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' ), |
|
56 | + 'name' => __('Default Give Styles', 'give'), |
|
57 | + 'desc' => __('You can disable Give\'s default styles for donation forms and other frontend elements.', 'give'), |
|
58 | 58 | 'id' => 'css', |
59 | 59 | 'type' => 'radio_inline', |
60 | 60 | 'default' => 'enabled', |
61 | 61 | 'options' => array( |
62 | - 'enabled' => __( 'Enabled', 'give' ), |
|
63 | - 'disabled' => __( 'Disabled', 'give' ), |
|
62 | + 'enabled' => __('Enabled', 'give'), |
|
63 | + 'disabled' => __('Disabled', 'give'), |
|
64 | 64 | ), |
65 | 65 | ), |
66 | 66 | array( |
67 | - 'name' => __( 'Floating Labels', 'give' ), |
|
67 | + 'name' => __('Floating Labels', 'give'), |
|
68 | 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( |
|
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 | 70 | 'a' => array( |
71 | 71 | 'href' => array(), |
72 | 72 | 'target' => array(), |
73 | 73 | ), |
74 | - ) ), esc_url( 'http://docs.givewp.com/form-floating-labels' ) ), |
|
74 | + )), esc_url('http://docs.givewp.com/form-floating-labels')), |
|
75 | 75 | 'id' => 'floatlabels', |
76 | 76 | 'type' => 'radio_inline', |
77 | 77 | 'default' => 'disabled', |
78 | 78 | 'options' => array( |
79 | - 'enabled' => __( 'Enabled', 'give' ), |
|
80 | - 'disabled' => __( 'Disabled', 'give' ), |
|
79 | + 'enabled' => __('Enabled', 'give'), |
|
80 | + 'disabled' => __('Disabled', 'give'), |
|
81 | 81 | ), |
82 | 82 | ), |
83 | 83 | array( |
84 | - 'name' => __( 'Welcome Screen', 'give' ), |
|
84 | + 'name' => __('Welcome Screen', 'give'), |
|
85 | 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( |
|
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 | 87 | 'a' => array( |
88 | 88 | 'href' => array(), |
89 | 89 | 'target' => array(), |
90 | 90 | ), |
91 | - ) ), esc_url( admin_url( 'index.php?page=give-about' ) ) ), |
|
91 | + )), esc_url(admin_url('index.php?page=give-about'))), |
|
92 | 92 | 'id' => 'welcome', |
93 | 93 | 'type' => 'radio_inline', |
94 | 94 | 'default' => 'enabled', |
95 | 95 | 'options' => array( |
96 | - 'enabled' => __( 'Enabled', 'give' ), |
|
97 | - 'disabled' => __( 'Disabled', 'give' ), |
|
96 | + 'enabled' => __('Enabled', 'give'), |
|
97 | + 'disabled' => __('Disabled', 'give'), |
|
98 | 98 | ), |
99 | 99 | ), |
100 | 100 | array( |
101 | - 'name' => __( 'Company Donations', 'give' ), |
|
102 | - 'desc' => __( 'Do you want a Company field to appear after First Name and Last Name?', 'give' ), |
|
101 | + 'name' => __('Company Donations', 'give'), |
|
102 | + 'desc' => __('Do you want a Company field to appear after First Name and Last Name?', 'give'), |
|
103 | 103 | 'id' => 'company_field', |
104 | 104 | 'type' => 'radio_inline', |
105 | 105 | 'default' => 'disabled', |
106 | 106 | 'options' => array( |
107 | - 'disabled' => __( 'Disabled', 'give' ), |
|
108 | - 'required' => __( 'Required', 'give' ), |
|
109 | - 'optional' => __( 'Optional', 'give' ), |
|
107 | + 'disabled' => __('Disabled', 'give'), |
|
108 | + 'required' => __('Required', 'give'), |
|
109 | + 'optional' => __('Optional', 'give'), |
|
110 | 110 | ), |
111 | 111 | ), |
112 | 112 | array( |
113 | - 'name' => __( 'Display Settings Docs Link', 'give' ), |
|
113 | + 'name' => __('Display Settings Docs Link', 'give'), |
|
114 | 114 | 'id' => 'display_settings_docs_link', |
115 | - 'url' => esc_url( 'http://docs.givewp.com/form-display-options' ), |
|
116 | - 'title' => __( 'Display Options Settings', 'give' ), |
|
115 | + 'url' => esc_url('http://docs.givewp.com/form-display-options'), |
|
116 | + 'title' => __('Display Options Settings', 'give'), |
|
117 | 117 | 'type' => 'give_docs_link', |
118 | 118 | ), |
119 | 119 | array( |
@@ -130,78 +130,78 @@ discard block |
||
130 | 130 | 'type' => 'title', |
131 | 131 | ), |
132 | 132 | array( |
133 | - 'name' => __( 'Form Single Views', 'give' ), |
|
134 | - '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' ), |
|
133 | + 'name' => __('Form Single Views', 'give'), |
|
134 | + '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'), |
|
135 | 135 | 'id' => 'forms_singular', |
136 | 136 | 'type' => 'radio_inline', |
137 | 137 | 'default' => 'enabled', |
138 | 138 | 'options' => array( |
139 | - 'enabled' => __( 'Enabled', 'give' ), |
|
140 | - 'disabled' => __( 'Disabled', 'give' ), |
|
139 | + 'enabled' => __('Enabled', 'give'), |
|
140 | + 'disabled' => __('Disabled', 'give'), |
|
141 | 141 | ), |
142 | 142 | ), |
143 | 143 | array( |
144 | - 'name' => __( 'Form Archives', 'give' ), |
|
145 | - '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( |
|
144 | + 'name' => __('Form Archives', 'give'), |
|
145 | + '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( |
|
146 | 146 | 'a' => array( |
147 | 147 | 'href' => array(), |
148 | 148 | 'target' => array(), |
149 | 149 | ), |
150 | - ) ), esc_url( admin_url( 'options-permalink.php' ) ) ), |
|
150 | + )), esc_url(admin_url('options-permalink.php'))), |
|
151 | 151 | 'id' => 'forms_archives', |
152 | 152 | 'type' => 'radio_inline', |
153 | 153 | 'default' => 'enabled', |
154 | 154 | 'options' => array( |
155 | - 'enabled' => __( 'Enabled', 'give' ), |
|
156 | - 'disabled' => __( 'Disabled', 'give' ), |
|
155 | + 'enabled' => __('Enabled', 'give'), |
|
156 | + 'disabled' => __('Disabled', 'give'), |
|
157 | 157 | ), |
158 | 158 | ), |
159 | 159 | array( |
160 | - 'name' => __( 'Form Excerpts', 'give' ), |
|
161 | - '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' ), |
|
160 | + 'name' => __('Form Excerpts', 'give'), |
|
161 | + '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'), |
|
162 | 162 | 'id' => 'forms_excerpt', |
163 | 163 | 'type' => 'radio_inline', |
164 | 164 | 'default' => 'enabled', |
165 | 165 | 'options' => array( |
166 | - 'enabled' => __( 'Enabled', 'give' ), |
|
167 | - 'disabled' => __( 'Disabled', 'give' ), |
|
166 | + 'enabled' => __('Enabled', 'give'), |
|
167 | + 'disabled' => __('Disabled', 'give'), |
|
168 | 168 | ), |
169 | 169 | ), |
170 | 170 | array( |
171 | - 'name' => __( 'Form Featured Image', 'give' ), |
|
172 | - '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' ), |
|
171 | + 'name' => __('Form Featured Image', 'give'), |
|
172 | + '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'), |
|
173 | 173 | 'id' => 'form_featured_img', |
174 | 174 | 'type' => 'radio_inline', |
175 | 175 | 'default' => 'enabled', |
176 | 176 | 'options' => array( |
177 | - 'enabled' => __( 'Enabled', 'give' ), |
|
178 | - 'disabled' => __( 'Disabled', 'give' ), |
|
177 | + 'enabled' => __('Enabled', 'give'), |
|
178 | + 'disabled' => __('Disabled', 'give'), |
|
179 | 179 | ), |
180 | 180 | ), |
181 | 181 | array( |
182 | - 'name' => __( 'Featured Image Size', 'give' ), |
|
183 | - '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' ), |
|
182 | + 'name' => __('Featured Image Size', 'give'), |
|
183 | + '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'), |
|
184 | 184 | 'id' => 'featured_image_size', |
185 | 185 | 'type' => 'select', |
186 | 186 | 'default' => 'large', |
187 | 187 | 'options' => give_get_featured_image_sizes(), |
188 | 188 | ), |
189 | 189 | array( |
190 | - 'name' => __( 'Single Form Sidebar', 'give' ), |
|
191 | - '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' ), |
|
190 | + 'name' => __('Single Form Sidebar', 'give'), |
|
191 | + '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'), |
|
192 | 192 | 'id' => 'form_sidebar', |
193 | 193 | 'type' => 'radio_inline', |
194 | 194 | 'default' => 'enabled', |
195 | 195 | 'options' => array( |
196 | - 'enabled' => __( 'Enabled', 'give' ), |
|
197 | - 'disabled' => __( 'Disabled', 'give' ), |
|
196 | + 'enabled' => __('Enabled', 'give'), |
|
197 | + 'disabled' => __('Disabled', 'give'), |
|
198 | 198 | ), |
199 | 199 | ), |
200 | 200 | array( |
201 | - 'name' => __( 'Post Types Docs Link', 'give' ), |
|
201 | + 'name' => __('Post Types Docs Link', 'give'), |
|
202 | 202 | 'id' => 'post_types_settings_docs_link', |
203 | - 'url' => esc_url( 'http://docs.givewp.com/settings-post-types' ), |
|
204 | - 'title' => __( 'Post Types Settings', 'give' ), |
|
203 | + 'url' => esc_url('http://docs.givewp.com/settings-post-types'), |
|
204 | + 'title' => __('Post Types Settings', 'give'), |
|
205 | 205 | 'type' => 'give_docs_link', |
206 | 206 | ), |
207 | 207 | array( |
@@ -218,32 +218,32 @@ discard block |
||
218 | 218 | 'type' => 'title', |
219 | 219 | ), |
220 | 220 | array( |
221 | - 'name' => __( 'Form Categories', 'give' ), |
|
222 | - 'desc' => __( 'Enable Categories for all Give forms.', 'give' ), |
|
221 | + 'name' => __('Form Categories', 'give'), |
|
222 | + 'desc' => __('Enable Categories for all Give forms.', 'give'), |
|
223 | 223 | 'id' => 'categories', |
224 | 224 | 'type' => 'radio_inline', |
225 | 225 | 'default' => 'disabled', |
226 | 226 | 'options' => array( |
227 | - 'enabled' => __( 'Enabled', 'give' ), |
|
228 | - 'disabled' => __( 'Disabled', 'give' ), |
|
227 | + 'enabled' => __('Enabled', 'give'), |
|
228 | + 'disabled' => __('Disabled', 'give'), |
|
229 | 229 | ), |
230 | 230 | ), |
231 | 231 | array( |
232 | - 'name' => __( 'Form Tags', 'give' ), |
|
233 | - 'desc' => __( 'Enable Tags for all Give forms.', 'give' ), |
|
232 | + 'name' => __('Form Tags', 'give'), |
|
233 | + 'desc' => __('Enable Tags for all Give forms.', 'give'), |
|
234 | 234 | 'id' => 'tags', |
235 | 235 | 'type' => 'radio_inline', |
236 | 236 | 'default' => 'disabled', |
237 | 237 | 'options' => array( |
238 | - 'enabled' => __( 'Enabled', 'give' ), |
|
239 | - 'disabled' => __( 'Disabled', 'give' ), |
|
238 | + 'enabled' => __('Enabled', 'give'), |
|
239 | + 'disabled' => __('Disabled', 'give'), |
|
240 | 240 | ), |
241 | 241 | ), |
242 | 242 | array( |
243 | - 'name' => __( 'Taxonomies Docs Link', 'give' ), |
|
243 | + 'name' => __('Taxonomies Docs Link', 'give'), |
|
244 | 244 | 'id' => 'taxonomies_settings_docs_link', |
245 | - 'url' => esc_url( 'http://docs.givewp.com/settings-taxonomies' ), |
|
246 | - 'title' => __( 'Taxonomies Settings', 'give' ), |
|
245 | + 'url' => esc_url('http://docs.givewp.com/settings-taxonomies'), |
|
246 | + 'title' => __('Taxonomies Settings', 'give'), |
|
247 | 247 | 'type' => 'give_docs_link', |
248 | 248 | ), |
249 | 249 | array( |
@@ -260,36 +260,36 @@ discard block |
||
260 | 260 | 'type' => 'title', |
261 | 261 | ), |
262 | 262 | array( |
263 | - 'name' => __( 'Terms and Conditions', 'give' ), |
|
264 | - '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' ), |
|
263 | + 'name' => __('Terms and Conditions', 'give'), |
|
264 | + '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'), |
|
265 | 265 | 'id' => 'terms', |
266 | 266 | 'type' => 'radio_inline', |
267 | 267 | 'default' => 'disabled', |
268 | 268 | 'options' => array( |
269 | - 'enabled' => __( 'Enabled', 'give' ), |
|
270 | - 'disabled' => __( 'Disabled', 'give' ), |
|
269 | + 'enabled' => __('Enabled', 'give'), |
|
270 | + 'disabled' => __('Disabled', 'give'), |
|
271 | 271 | ), |
272 | 272 | ), |
273 | 273 | array( |
274 | - 'name' => __( 'Agree to Terms Label', 'give' ), |
|
275 | - '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' ), |
|
274 | + 'name' => __('Agree to Terms Label', 'give'), |
|
275 | + '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'), |
|
276 | 276 | 'id' => 'agree_to_terms_label', |
277 | 277 | 'attributes' => array( |
278 | - 'placeholder' => esc_attr__( 'Agree to Terms?', 'give' ), |
|
278 | + 'placeholder' => esc_attr__('Agree to Terms?', 'give'), |
|
279 | 279 | ), |
280 | 280 | 'type' => 'text', |
281 | 281 | ), |
282 | 282 | array( |
283 | - 'name' => __( 'Agreement Text', 'give' ), |
|
284 | - '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' ), |
|
283 | + 'name' => __('Agreement Text', 'give'), |
|
284 | + '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'), |
|
285 | 285 | 'id' => 'agreement_text', |
286 | 286 | 'type' => 'wysiwyg', |
287 | 287 | ), |
288 | 288 | array( |
289 | - 'name' => __( 'Terms and Conditions Docs Link', 'give' ), |
|
289 | + 'name' => __('Terms and Conditions Docs Link', 'give'), |
|
290 | 290 | 'id' => 'terms_settings_docs_link', |
291 | - 'url' => esc_url( 'http://docs.givewp.com/settings-terms' ), |
|
292 | - 'title' => __( 'Terms and Conditions Settings', 'give' ), |
|
291 | + 'url' => esc_url('http://docs.givewp.com/settings-terms'), |
|
292 | + 'title' => __('Terms and Conditions Settings', 'give'), |
|
293 | 293 | 'type' => 'give_docs_link', |
294 | 294 | ), |
295 | 295 | array( |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | * Filter the display options settings. |
305 | 305 | * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8 |
306 | 306 | */ |
307 | - $settings = apply_filters( 'give_settings_display', $settings ); |
|
307 | + $settings = apply_filters('give_settings_display', $settings); |
|
308 | 308 | |
309 | 309 | /** |
310 | 310 | * Filter the settings. |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | * |
314 | 314 | * @param array $settings |
315 | 315 | */ |
316 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
316 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
317 | 317 | |
318 | 318 | // Output. |
319 | 319 | return $settings; |
@@ -327,13 +327,13 @@ discard block |
||
327 | 327 | */ |
328 | 328 | public function get_sections() { |
329 | 329 | $sections = array( |
330 | - 'display-settings' => __( 'Display', 'give' ), |
|
331 | - 'post-types' => __( 'Post Types', 'give' ), |
|
332 | - 'taxonomies' => __( 'Taxonomies', 'give' ), |
|
333 | - 'term-and-conditions' => __( 'Terms and Conditions', 'give' ), |
|
330 | + 'display-settings' => __('Display', 'give'), |
|
331 | + 'post-types' => __('Post Types', 'give'), |
|
332 | + 'taxonomies' => __('Taxonomies', 'give'), |
|
333 | + 'term-and-conditions' => __('Terms and Conditions', 'give'), |
|
334 | 334 | ); |
335 | 335 | |
336 | - return apply_filters( 'give_get_sections_' . $this->id, $sections ); |
|
336 | + return apply_filters('give_get_sections_'.$this->id, $sections); |
|
337 | 337 | } |
338 | 338 | } |
339 | 339 |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Settings_Email' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Email')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Email. |
@@ -27,13 +27,13 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function __construct() { |
29 | 29 | $this->id = 'emails'; |
30 | - $this->label = esc_html__( 'Emails', 'give' ); |
|
30 | + $this->label = esc_html__('Emails', 'give'); |
|
31 | 31 | |
32 | 32 | $this->default_tab = 'email-settings'; |
33 | 33 | |
34 | 34 | parent::__construct(); |
35 | 35 | |
36 | - add_action( 'give_admin_field_email_notification', array( $this, 'email_notification_setting' ) ); |
|
36 | + add_action('give_admin_field_email_notification', array($this, 'email_notification_setting')); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -46,13 +46,13 @@ discard block |
||
46 | 46 | $settings = array(); |
47 | 47 | $current_section = give_get_current_setting_section(); |
48 | 48 | |
49 | - switch ( $current_section ) { |
|
49 | + switch ($current_section) { |
|
50 | 50 | case 'email-settings' : |
51 | 51 | $settings = array( |
52 | 52 | |
53 | 53 | // Section 1: Email Notification Listing. |
54 | 54 | array( |
55 | - 'desc' => __( 'Email notifications sent from Give are listed below. Click on an email to configure it.', 'give' ), |
|
55 | + 'desc' => __('Email notifications sent from Give are listed below. Click on an email to configure it.', 'give'), |
|
56 | 56 | 'type' => 'title', |
57 | 57 | 'id' => 'give_email_notification_settings', |
58 | 58 | 'table_html' => false, |
@@ -67,42 +67,42 @@ discard block |
||
67 | 67 | |
68 | 68 | // Section 2: Email Sender Setting |
69 | 69 | array( |
70 | - 'title' => __( 'Email Sender Options', 'give' ), |
|
70 | + 'title' => __('Email Sender Options', 'give'), |
|
71 | 71 | 'id' => 'give_title_email_settings_1', |
72 | 72 | 'type' => 'title', |
73 | 73 | ), |
74 | 74 | array( |
75 | 75 | 'id' => 'email_template', |
76 | - 'name' => esc_html__( 'Email Template', 'give' ), |
|
77 | - 'desc' => esc_html__( 'Choose your template from the available registered template types.', 'give' ), |
|
76 | + 'name' => esc_html__('Email Template', 'give'), |
|
77 | + 'desc' => esc_html__('Choose your template from the available registered template types.', 'give'), |
|
78 | 78 | 'type' => 'select', |
79 | 79 | 'options' => give_get_email_templates(), |
80 | 80 | ), |
81 | 81 | array( |
82 | 82 | 'id' => 'email_logo', |
83 | - 'name' => esc_html__( 'Logo', 'give' ), |
|
84 | - 'desc' => esc_html__( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ), |
|
83 | + 'name' => esc_html__('Logo', 'give'), |
|
84 | + 'desc' => esc_html__('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'), |
|
85 | 85 | 'type' => 'file', |
86 | 86 | ), |
87 | 87 | array( |
88 | 88 | 'id' => 'from_name', |
89 | - 'name' => esc_html__( 'From Name', 'give' ), |
|
90 | - 'desc' => esc_html__( 'The name which appears in the "From" field in all Give donation emails.', 'give' ), |
|
91 | - 'default' => get_bloginfo( 'name' ), |
|
89 | + 'name' => esc_html__('From Name', 'give'), |
|
90 | + 'desc' => esc_html__('The name which appears in the "From" field in all Give donation emails.', 'give'), |
|
91 | + 'default' => get_bloginfo('name'), |
|
92 | 92 | 'type' => 'text', |
93 | 93 | ), |
94 | 94 | array( |
95 | 95 | 'id' => 'from_email', |
96 | - 'name' => esc_html__( 'From Email', 'give' ), |
|
97 | - 'desc' => esc_html__( 'Email address from which all Give emails are sent from. This will act as the "from" and "reply-to" email address.', 'give' ), |
|
98 | - 'default' => get_bloginfo( 'admin_email' ), |
|
96 | + 'name' => esc_html__('From Email', 'give'), |
|
97 | + 'desc' => esc_html__('Email address from which all Give emails are sent from. This will act as the "from" and "reply-to" email address.', 'give'), |
|
98 | + 'default' => get_bloginfo('admin_email'), |
|
99 | 99 | 'type' => 'text', |
100 | 100 | ), |
101 | 101 | array( |
102 | - 'name' => esc_html__( 'Donation Notification Settings Docs Link', 'give' ), |
|
102 | + 'name' => esc_html__('Donation Notification Settings Docs Link', 'give'), |
|
103 | 103 | 'id' => 'donation_notification_settings_docs_link', |
104 | - 'url' => esc_url( 'http://docs.givewp.com/settings-donation-notification' ), |
|
105 | - 'title' => __( 'Donation Notification Settings', 'give' ), |
|
104 | + 'url' => esc_url('http://docs.givewp.com/settings-donation-notification'), |
|
105 | + 'title' => __('Donation Notification Settings', 'give'), |
|
106 | 106 | 'type' => 'give_docs_link', |
107 | 107 | ), |
108 | 108 | array( |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * Filter the emails settings. |
118 | 118 | * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8 |
119 | 119 | */ |
120 | - $settings = apply_filters( 'give_settings_emails', $settings ); |
|
120 | + $settings = apply_filters('give_settings_emails', $settings); |
|
121 | 121 | |
122 | 122 | /** |
123 | 123 | * Filter the settings. |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * |
127 | 127 | * @param array $settings |
128 | 128 | */ |
129 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
129 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
130 | 130 | |
131 | 131 | // Output. |
132 | 132 | return $settings; |
@@ -140,10 +140,10 @@ discard block |
||
140 | 140 | */ |
141 | 141 | public function get_sections() { |
142 | 142 | $sections = array( |
143 | - 'email-settings' => esc_html__( 'Email Settings', 'give' ), |
|
143 | + 'email-settings' => esc_html__('Email Settings', 'give'), |
|
144 | 144 | ); |
145 | 145 | |
146 | - return apply_filters( 'give_get_sections_' . $this->id, $sections ); |
|
146 | + return apply_filters('give_get_sections_'.$this->id, $sections); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function email_notification_setting() { |
156 | 156 | // Load email notification table. |
157 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/emails/class-email-notification-table.php'; |
|
157 | + require_once GIVE_PLUGIN_DIR.'includes/admin/emails/class-email-notification-table.php'; |
|
158 | 158 | |
159 | 159 | // Init table. |
160 | 160 | $email_notifications_table = new Give_Email_Notification_Table(); |
@@ -173,13 +173,13 @@ discard block |
||
173 | 173 | * @return void |
174 | 174 | */ |
175 | 175 | public function output() { |
176 | - if ( $this->enable_save ) { |
|
177 | - $GLOBALS['give_hide_save_button'] = apply_filters( 'give_hide_save_button_on_email_admin_setting_page', false ); |
|
176 | + if ($this->enable_save) { |
|
177 | + $GLOBALS['give_hide_save_button'] = apply_filters('give_hide_save_button_on_email_admin_setting_page', false); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | $settings = $this->get_settings(); |
181 | 181 | |
182 | - Give_Admin_Settings::output_fields( $settings, 'give_settings' ); |
|
182 | + Give_Admin_Settings::output_fields($settings, 'give_settings'); |
|
183 | 183 | } |
184 | 184 | } |
185 | 185 |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Settings_Gateways' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Gateways')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Gateways. |
@@ -27,15 +27,15 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function __construct() { |
29 | 29 | $this->id = 'gateways'; |
30 | - $this->label = esc_html__( 'Payment Gateways', 'give' ); |
|
30 | + $this->label = esc_html__('Payment Gateways', 'give'); |
|
31 | 31 | |
32 | 32 | $this->default_tab = 'gateways-settings'; |
33 | 33 | |
34 | 34 | parent::__construct(); |
35 | 35 | |
36 | 36 | // Do not use main form for this tab. |
37 | - if ( give_get_current_setting_tab() === $this->id ) { |
|
38 | - add_action( 'give_admin_field_enabled_gateways', array( $this, 'render_enabled_gateways' ), 10, 2 ); |
|
37 | + if (give_get_current_setting_tab() === $this->id) { |
|
38 | + add_action('give_admin_field_enabled_gateways', array($this, 'render_enabled_gateways'), 10, 2); |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $settings = array(); |
50 | 50 | $current_section = give_get_current_setting_section(); |
51 | 51 | |
52 | - switch ( $current_section ) { |
|
52 | + switch ($current_section) { |
|
53 | 53 | case 'paypal-standard': |
54 | 54 | $settings = array( |
55 | 55 | // Section 2: PayPal Standard. |
@@ -58,55 +58,55 @@ discard block |
||
58 | 58 | 'id' => 'give_title_gateway_settings_2', |
59 | 59 | ), |
60 | 60 | array( |
61 | - 'name' => __( 'PayPal Email', 'give' ), |
|
62 | - 'desc' => __( 'Enter your PayPal account\'s email.', 'give' ), |
|
61 | + 'name' => __('PayPal Email', 'give'), |
|
62 | + 'desc' => __('Enter your PayPal account\'s email.', 'give'), |
|
63 | 63 | 'id' => 'paypal_email', |
64 | 64 | 'type' => 'email', |
65 | 65 | ), |
66 | 66 | array( |
67 | - 'name' => __( 'PayPal Page Style', 'give' ), |
|
68 | - 'desc' => __( 'Enter the name of the PayPal page style to use, or leave blank to use the default.', 'give' ), |
|
67 | + 'name' => __('PayPal Page Style', 'give'), |
|
68 | + 'desc' => __('Enter the name of the PayPal page style to use, or leave blank to use the default.', 'give'), |
|
69 | 69 | 'id' => 'paypal_page_style', |
70 | 70 | 'type' => 'text', |
71 | 71 | ), |
72 | 72 | array( |
73 | - 'name' => __( 'PayPal Transaction Type', 'give' ), |
|
74 | - 'desc' => __( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ), |
|
73 | + 'name' => __('PayPal Transaction Type', 'give'), |
|
74 | + 'desc' => __('Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give'), |
|
75 | 75 | 'id' => 'paypal_button_type', |
76 | 76 | 'type' => 'radio_inline', |
77 | 77 | 'options' => array( |
78 | - 'donation' => __( 'Donation', 'give' ), |
|
79 | - 'standard' => __( 'Standard Transaction', 'give' ) |
|
78 | + 'donation' => __('Donation', 'give'), |
|
79 | + 'standard' => __('Standard Transaction', 'give') |
|
80 | 80 | ), |
81 | 81 | 'default' => 'donation', |
82 | 82 | ), |
83 | 83 | array( |
84 | - 'name' => __( 'Billing Details', 'give' ), |
|
85 | - 'desc' => __( 'This option will enable the billing details section for PayPal Standard which requires the donor\'s address to complete the donation. These fields are not required by PayPal to process the transaction, but you may have a need to collect the data.', 'give' ), |
|
84 | + 'name' => __('Billing Details', 'give'), |
|
85 | + 'desc' => __('This option will enable the billing details section for PayPal Standard which requires the donor\'s address to complete the donation. These fields are not required by PayPal to process the transaction, but you may have a need to collect the data.', 'give'), |
|
86 | 86 | 'id' => 'paypal_standard_billing_details', |
87 | 87 | 'type' => 'radio_inline', |
88 | 88 | 'default' => 'disabled', |
89 | 89 | 'options' => array( |
90 | - 'enabled' => __( 'Enabled', 'give' ), |
|
91 | - 'disabled' => __( 'Disabled', 'give' ), |
|
90 | + 'enabled' => __('Enabled', 'give'), |
|
91 | + 'disabled' => __('Disabled', 'give'), |
|
92 | 92 | ) |
93 | 93 | ), |
94 | 94 | array( |
95 | - 'name' => __( 'PayPal IPN Verification', 'give' ), |
|
96 | - 'desc' => __( 'If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give' ), |
|
95 | + 'name' => __('PayPal IPN Verification', 'give'), |
|
96 | + 'desc' => __('If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give'), |
|
97 | 97 | 'id' => 'paypal_verification', |
98 | 98 | 'type' => 'radio_inline', |
99 | 99 | 'default' => 'enabled', |
100 | 100 | 'options' => array( |
101 | - 'enabled' => __( 'Enabled', 'give' ), |
|
102 | - 'disabled' => __( 'Disabled', 'give' ), |
|
101 | + 'enabled' => __('Enabled', 'give'), |
|
102 | + 'disabled' => __('Disabled', 'give'), |
|
103 | 103 | ) |
104 | 104 | ), |
105 | 105 | array( |
106 | - 'name' => __( 'PayPal Standard Gateway Settings Docs Link', 'give' ), |
|
106 | + 'name' => __('PayPal Standard Gateway Settings Docs Link', 'give'), |
|
107 | 107 | 'id' => 'paypal_standard_gateway_settings_docs_link', |
108 | - 'url' => esc_url( 'http://docs.givewp.com/settings-gateway-paypal-standard' ), |
|
109 | - 'title' => __( 'PayPal Standard Gateway Settings', 'give' ), |
|
108 | + 'url' => esc_url('http://docs.givewp.com/settings-gateway-paypal-standard'), |
|
109 | + 'title' => __('PayPal Standard Gateway Settings', 'give'), |
|
110 | 110 | 'type' => 'give_docs_link', |
111 | 111 | ), |
112 | 112 | array( |
@@ -124,19 +124,19 @@ discard block |
||
124 | 124 | 'id' => 'give_title_gateway_settings_3', |
125 | 125 | ), |
126 | 126 | array( |
127 | - 'name' => __( 'Collect Billing Details', 'give' ), |
|
128 | - 'desc' => __( 'Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give' ), |
|
127 | + 'name' => __('Collect Billing Details', 'give'), |
|
128 | + 'desc' => __('Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give'), |
|
129 | 129 | 'id' => 'give_offline_donation_enable_billing_fields', |
130 | 130 | 'type' => 'radio_inline', |
131 | 131 | 'default' => 'disabled', |
132 | 132 | 'options' => array( |
133 | - 'enabled' => __( 'Enabled', 'give' ), |
|
134 | - 'disabled' => __( 'Disabled', 'give' ) |
|
133 | + 'enabled' => __('Enabled', 'give'), |
|
134 | + 'disabled' => __('Disabled', 'give') |
|
135 | 135 | ) |
136 | 136 | ), |
137 | 137 | array( |
138 | - 'name' => __( 'Offline Donation Instructions', 'give' ), |
|
139 | - 'desc' => __( 'The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give' ), |
|
138 | + 'name' => __('Offline Donation Instructions', 'give'), |
|
139 | + 'desc' => __('The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give'), |
|
140 | 140 | 'id' => 'global_offline_donation_content', |
141 | 141 | 'default' => give_get_default_offline_donation_content(), |
142 | 142 | 'type' => 'wysiwyg', |
@@ -145,10 +145,10 @@ discard block |
||
145 | 145 | ) |
146 | 146 | ), |
147 | 147 | array( |
148 | - 'name' => esc_html__( 'Offline Donations Settings Docs Link', 'give' ), |
|
148 | + 'name' => esc_html__('Offline Donations Settings Docs Link', 'give'), |
|
149 | 149 | 'id' => 'offline_gateway_settings_docs_link', |
150 | - 'url' => esc_url( 'http://docs.givewp.com/offlinegateway' ), |
|
151 | - 'title' => __( 'Offline Gateway Settings', 'give' ), |
|
150 | + 'url' => esc_url('http://docs.givewp.com/offlinegateway'), |
|
151 | + 'title' => __('Offline Gateway Settings', 'give'), |
|
152 | 152 | 'type' => 'give_docs_link', |
153 | 153 | ), |
154 | 154 | array( |
@@ -166,19 +166,19 @@ discard block |
||
166 | 166 | 'type' => 'title' |
167 | 167 | ), |
168 | 168 | array( |
169 | - 'name' => __( 'Test Mode', 'give' ), |
|
170 | - 'desc' => __( 'While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give' ), |
|
169 | + 'name' => __('Test Mode', 'give'), |
|
170 | + 'desc' => __('While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give'), |
|
171 | 171 | 'id' => 'test_mode', |
172 | 172 | 'type' => 'radio_inline', |
173 | 173 | 'default' => 'disabled', |
174 | 174 | 'options' => array( |
175 | - 'enabled' => __( 'Enabled', 'give' ), |
|
176 | - 'disabled' => __( 'Disabled', 'give' ), |
|
175 | + 'enabled' => __('Enabled', 'give'), |
|
176 | + 'disabled' => __('Disabled', 'give'), |
|
177 | 177 | ) |
178 | 178 | ), |
179 | 179 | array( |
180 | - 'name' => __( 'Enabled Gateways', 'give' ), |
|
181 | - 'desc' => __( 'Enable your payment gateway. Can be ordered by dragging.', 'give' ), |
|
180 | + 'name' => __('Enabled Gateways', 'give'), |
|
181 | + 'desc' => __('Enable your payment gateway. Can be ordered by dragging.', 'give'), |
|
182 | 182 | 'id' => 'gateways', |
183 | 183 | 'type' => 'enabled_gateways' |
184 | 184 | ), |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | * This setting will not render on admin setting screen but help internal code to recognize "gateways_label" setting and add them to give setting when save. |
191 | 191 | */ |
192 | 192 | array( |
193 | - 'name' => __( 'Gateways Label', 'give' ), |
|
193 | + 'name' => __('Gateways Label', 'give'), |
|
194 | 194 | 'desc' => '', |
195 | 195 | 'id' => 'gateways_label', |
196 | 196 | 'type' => 'gateways_label_hidden' |
@@ -203,17 +203,17 @@ discard block |
||
203 | 203 | * This setting will not render on admin setting screen but help internal code to recognize "default_gateway" setting and add them to give setting when save. |
204 | 204 | */ |
205 | 205 | array( |
206 | - 'name' => __( 'Default Gateway', 'give' ), |
|
207 | - 'desc' => __( 'The gateway that will be selected by default.', 'give' ), |
|
206 | + 'name' => __('Default Gateway', 'give'), |
|
207 | + 'desc' => __('The gateway that will be selected by default.', 'give'), |
|
208 | 208 | 'id' => 'default_gateway', |
209 | 209 | 'type' => 'default_gateway_hidden' |
210 | 210 | ), |
211 | 211 | |
212 | 212 | array( |
213 | - 'name' => __( 'Gateways Docs Link', 'give' ), |
|
213 | + 'name' => __('Gateways Docs Link', 'give'), |
|
214 | 214 | 'id' => 'gateway_settings_docs_link', |
215 | - 'url' => esc_url( 'http://docs.givewp.com/settings-gateways' ), |
|
216 | - 'title' => __( 'Gateway Settings', 'give' ), |
|
215 | + 'url' => esc_url('http://docs.givewp.com/settings-gateways'), |
|
216 | + 'title' => __('Gateway Settings', 'give'), |
|
217 | 217 | 'type' => 'give_docs_link', |
218 | 218 | ), |
219 | 219 | array( |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | * Filter the payment gateways settings. |
229 | 229 | * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8 |
230 | 230 | */ |
231 | - $settings = apply_filters( 'give_settings_gateways', $settings ); |
|
231 | + $settings = apply_filters('give_settings_gateways', $settings); |
|
232 | 232 | |
233 | 233 | /** |
234 | 234 | * Filter the settings. |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | * |
238 | 238 | * @param array $settings |
239 | 239 | */ |
240 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
240 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
241 | 241 | |
242 | 242 | // Output. |
243 | 243 | return $settings; |
@@ -251,12 +251,12 @@ discard block |
||
251 | 251 | */ |
252 | 252 | public function get_sections() { |
253 | 253 | $sections = array( |
254 | - 'gateways-settings' => __( 'Gateways', 'give' ), |
|
255 | - 'paypal-standard' => __( 'PayPal Standard', 'give' ), |
|
256 | - 'offline-donations' => __( 'Offline Donations', 'give' ) |
|
254 | + 'gateways-settings' => __('Gateways', 'give'), |
|
255 | + 'paypal-standard' => __('PayPal Standard', 'give'), |
|
256 | + 'offline-donations' => __('Offline Donations', 'give') |
|
257 | 257 | ); |
258 | 258 | |
259 | - return apply_filters( 'give_get_sections_' . $this->id, $sections ); |
|
259 | + return apply_filters('give_get_sections_'.$this->id, $sections); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | |
@@ -269,11 +269,11 @@ discard block |
||
269 | 269 | * @param $field |
270 | 270 | * @param $settings |
271 | 271 | */ |
272 | - public function render_enabled_gateways( $field, $settings ) { |
|
272 | + public function render_enabled_gateways($field, $settings) { |
|
273 | 273 | $id = $field['id']; |
274 | - $gateways = give_get_ordered_payment_gateways( give_get_payment_gateways() ); |
|
275 | - $gateways_label = give_get_option( 'gateways_label', array() ); |
|
276 | - $default_gateway = give_get_option( 'default_gateway', current( array_keys( $gateways ) ) ); |
|
274 | + $gateways = give_get_ordered_payment_gateways(give_get_payment_gateways()); |
|
275 | + $gateways_label = give_get_option('gateways_label', array()); |
|
276 | + $default_gateway = give_get_option('default_gateway', current(array_keys($gateways))); |
|
277 | 277 | |
278 | 278 | ob_start(); |
279 | 279 | |
@@ -288,50 +288,50 @@ discard block |
||
288 | 288 | <span>%3$s</span> |
289 | 289 | <span>%4$s</span> |
290 | 290 | ', |
291 | - __( 'Gateway', 'give' ), |
|
292 | - __( 'Label', 'give' ), |
|
293 | - __( 'Default', 'give' ), |
|
294 | - __( 'Enabled', 'give' ) |
|
291 | + __('Gateway', 'give'), |
|
292 | + __('Label', 'give'), |
|
293 | + __('Default', 'give'), |
|
294 | + __('Enabled', 'give') |
|
295 | 295 | ); |
296 | 296 | echo '</div>'; |
297 | 297 | |
298 | 298 | echo '<ul class="give-checklist-fields give-payment-gatways-list">'; |
299 | - foreach ( $gateways as $key => $option ) : |
|
299 | + foreach ($gateways as $key => $option) : |
|
300 | 300 | $enabled = null; |
301 | - if ( is_array( $settings ) && array_key_exists( $key, $settings ) ) { |
|
301 | + if (is_array($settings) && array_key_exists($key, $settings)) { |
|
302 | 302 | $enabled = '1'; |
303 | 303 | } |
304 | 304 | |
305 | 305 | echo '<li>'; |
306 | - printf( '<span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span>' ); |
|
307 | - printf( '<span class="admin-label">%s</span>', esc_html( $option['admin_label'] ) ); |
|
306 | + printf('<span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span>'); |
|
307 | + printf('<span class="admin-label">%s</span>', esc_html($option['admin_label'])); |
|
308 | 308 | |
309 | 309 | $label = ''; |
310 | - if ( ! empty( $gateways_label[ $key ] ) ) { |
|
311 | - $label = $gateways_label[ $key ]; |
|
310 | + if ( ! empty($gateways_label[$key])) { |
|
311 | + $label = $gateways_label[$key]; |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | printf( |
315 | 315 | '<input class="checkout-label" type="text" id="%1$s[%2$s]" name="%1$s[%2$s]" value="%3$s" placeholder="%4$s"/>', |
316 | 316 | 'gateways_label', |
317 | - esc_attr( $key ), |
|
318 | - esc_html( $label ), |
|
319 | - esc_html( $option['checkout_label'] ) |
|
317 | + esc_attr($key), |
|
318 | + esc_html($label), |
|
319 | + esc_html($option['checkout_label']) |
|
320 | 320 | ); |
321 | 321 | |
322 | 322 | printf( |
323 | 323 | '<input class="gateways-radio" type="radio" name="%1$s" value="%2$s" %3$s>', |
324 | 324 | 'default_gateway', |
325 | 325 | $key, |
326 | - checked( $key, $default_gateway, false ) |
|
326 | + checked($key, $default_gateway, false) |
|
327 | 327 | ); |
328 | 328 | |
329 | 329 | printf( |
330 | 330 | '<input class="gateways-checkbox" name="%1$s[%2$s]" id="%1$s[%2$s]" type="checkbox" value="1" %3$s data-payment-gateway="%4$s"/>', |
331 | - esc_attr( $id ), |
|
332 | - esc_attr( $key ), |
|
333 | - checked( '1', $enabled, false ), |
|
334 | - esc_html( $option['admin_label'] ) |
|
331 | + esc_attr($id), |
|
332 | + esc_attr($key), |
|
333 | + checked('1', $enabled, false), |
|
334 | + esc_html($option['admin_label']) |
|
335 | 335 | ); |
336 | 336 | echo '</li>'; |
337 | 337 | endforeach; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly. |
14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
14 | +if ( ! defined('ABSPATH')) { |
|
15 | 15 | exit; |
16 | 16 | } |
17 | 17 | |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | * @since 1.0 |
36 | 36 | */ |
37 | 37 | public function __construct() { |
38 | - add_action( 'admin_menu', array( $this, 'admin_menus' ) ); |
|
39 | - add_action( 'admin_head', array( $this, 'admin_head' ) ); |
|
40 | - add_action( 'admin_init', array( $this, 'welcome' ) ); |
|
38 | + add_action('admin_menu', array($this, 'admin_menus')); |
|
39 | + add_action('admin_head', array($this, 'admin_head')); |
|
40 | + add_action('admin_init', array($this, 'welcome')); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -49,45 +49,45 @@ discard block |
||
49 | 49 | * @return void |
50 | 50 | */ |
51 | 51 | public function admin_menus() { |
52 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
52 | + list($display_version) = explode('-', GIVE_VERSION); |
|
53 | 53 | |
54 | 54 | // About Page |
55 | 55 | add_dashboard_page( |
56 | 56 | /* translators: %s: Give version */ |
57 | - sprintf( esc_html__( 'Welcome to Give %s', 'give' ), $display_version ), |
|
58 | - esc_html__( 'Welcome to Give', 'give' ), |
|
57 | + sprintf(esc_html__('Welcome to Give %s', 'give'), $display_version), |
|
58 | + esc_html__('Welcome to Give', 'give'), |
|
59 | 59 | $this->minimum_capability, |
60 | 60 | 'give-about', |
61 | - array( $this, 'about_screen' ) |
|
61 | + array($this, 'about_screen') |
|
62 | 62 | ); |
63 | 63 | |
64 | 64 | // Changelog Page |
65 | 65 | add_dashboard_page( |
66 | - esc_html__( 'Give Changelog', 'give' ), |
|
67 | - esc_html__( 'Give Changelog', 'give' ), |
|
66 | + esc_html__('Give Changelog', 'give'), |
|
67 | + esc_html__('Give Changelog', 'give'), |
|
68 | 68 | $this->minimum_capability, |
69 | 69 | 'give-changelog', |
70 | - array( $this, 'changelog_screen' ) |
|
70 | + array($this, 'changelog_screen') |
|
71 | 71 | ); |
72 | 72 | |
73 | 73 | // Getting Started Page |
74 | 74 | add_dashboard_page( |
75 | 75 | /* translators: %s: Give version */ |
76 | - sprintf( esc_html__( 'Give %s - Getting Started Guide', 'give' ), $display_version ), |
|
77 | - esc_html__( 'Getting started with Give', 'give' ), |
|
76 | + sprintf(esc_html__('Give %s - Getting Started Guide', 'give'), $display_version), |
|
77 | + esc_html__('Getting started with Give', 'give'), |
|
78 | 78 | $this->minimum_capability, |
79 | 79 | 'give-getting-started', |
80 | - array( $this, 'getting_started_screen' ) |
|
80 | + array($this, 'getting_started_screen') |
|
81 | 81 | ); |
82 | 82 | |
83 | 83 | // Credits Page |
84 | 84 | add_dashboard_page( |
85 | 85 | /* translators: %s: Give version */ |
86 | - sprintf( esc_html__( 'Give %s - Credits', 'give' ), $display_version ), |
|
87 | - esc_html__( 'The people that build Give', 'give' ), |
|
86 | + sprintf(esc_html__('Give %s - Credits', 'give'), $display_version), |
|
87 | + esc_html__('The people that build Give', 'give'), |
|
88 | 88 | $this->minimum_capability, |
89 | 89 | 'give-credits', |
90 | - array( $this, 'credits_screen' ) |
|
90 | + array($this, 'credits_screen') |
|
91 | 91 | ); |
92 | 92 | } |
93 | 93 | |
@@ -100,10 +100,10 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function admin_head() { |
102 | 102 | |
103 | - remove_submenu_page( 'index.php', 'give-about' ); |
|
104 | - remove_submenu_page( 'index.php', 'give-changelog' ); |
|
105 | - remove_submenu_page( 'index.php', 'give-getting-started' ); |
|
106 | - remove_submenu_page( 'index.php', 'give-credits' ); |
|
103 | + remove_submenu_page('index.php', 'give-about'); |
|
104 | + remove_submenu_page('index.php', 'give-changelog'); |
|
105 | + remove_submenu_page('index.php', 'give-getting-started'); |
|
106 | + remove_submenu_page('index.php', 'give-credits'); |
|
107 | 107 | |
108 | 108 | } |
109 | 109 | |
@@ -115,24 +115,24 @@ discard block |
||
115 | 115 | * @return void |
116 | 116 | */ |
117 | 117 | public function tabs() { |
118 | - $selected = isset( $_GET['page'] ) ? $_GET['page'] : 'give-about'; |
|
118 | + $selected = isset($_GET['page']) ? $_GET['page'] : 'give-about'; |
|
119 | 119 | ?> |
120 | 120 | <h2 class="nav-tab-wrapper"> |
121 | 121 | <a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" |
122 | - href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-about' ), 'index.php' ) ) ); ?>"> |
|
123 | - <?php esc_html_e( 'About Give', 'give' ); ?> |
|
122 | + href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-about'), 'index.php'))); ?>"> |
|
123 | + <?php esc_html_e('About Give', 'give'); ?> |
|
124 | 124 | </a> |
125 | 125 | <a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" |
126 | - href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-getting-started' ), 'index.php' ) ) ); ?>"> |
|
127 | - <?php esc_html_e( 'Getting Started', 'give' ); ?> |
|
126 | + href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-getting-started'), 'index.php'))); ?>"> |
|
127 | + <?php esc_html_e('Getting Started', 'give'); ?> |
|
128 | 128 | </a> |
129 | 129 | <a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" |
130 | - href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-credits' ), 'index.php' ) ) ); ?>"> |
|
131 | - <?php esc_html_e( 'Credits', 'give' ); ?> |
|
130 | + href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-credits'), 'index.php'))); ?>"> |
|
131 | + <?php esc_html_e('Credits', 'give'); ?> |
|
132 | 132 | </a> |
133 | 133 | <a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" |
134 | - href="<?php echo esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-addons' ) ); ?>"> |
|
135 | - <?php esc_html_e( 'Add-ons', 'give' ); ?> |
|
134 | + href="<?php echo esc_url(admin_url('edit.php?post_type=give_forms&page=give-addons')); ?>"> |
|
135 | + <?php esc_html_e('Add-ons', 'give'); ?> |
|
136 | 136 | </a> |
137 | 137 | </h2> |
138 | 138 | <?php |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * @return void |
147 | 147 | */ |
148 | 148 | public function about_screen() { |
149 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
149 | + list($display_version) = explode('-', GIVE_VERSION); |
|
150 | 150 | ?> |
151 | 151 | <div class="wrap about-wrap"> |
152 | 152 | |
@@ -155,8 +155,8 @@ discard block |
||
155 | 155 | <p class="about-text"><?php |
156 | 156 | printf( |
157 | 157 | /* translators: %s: http://docs.givewp.com/docs */ |
158 | - __( 'Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. We encourage you to check out the <a href="%s" target="_blank">plugin documentation</a> and getting started guide below.', 'give' ), |
|
159 | - esc_url( 'http://docs.givewp.com/docs' ) |
|
158 | + __('Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. We encourage you to check out the <a href="%s" target="_blank">plugin documentation</a> and getting started guide below.', 'give'), |
|
159 | + esc_url('http://docs.givewp.com/docs') |
|
160 | 160 | ); |
161 | 161 | ?></p> |
162 | 162 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | <div class="give-badge"><?php |
166 | 166 | printf( |
167 | 167 | /* translators: %s: Give version */ |
168 | - esc_html__( 'Version %s', 'give' ), |
|
168 | + esc_html__('Version %s', 'give'), |
|
169 | 169 | $display_version |
170 | 170 | ); |
171 | 171 | ?></div> |
@@ -175,17 +175,17 @@ discard block |
||
175 | 175 | <div class="feature-section clearfix introduction"> |
176 | 176 | |
177 | 177 | <div class="video feature-section-item"> |
178 | - <img src="<?php echo GIVE_PLUGIN_URL . 'assets/dist/images/give-logo-photo-mashup.png' ?>" |
|
179 | - alt="<?php esc_attr_e( 'Give', 'give' ); ?>"> |
|
178 | + <img src="<?php echo GIVE_PLUGIN_URL.'assets/dist/images/give-logo-photo-mashup.png' ?>" |
|
179 | + alt="<?php esc_attr_e('Give', 'give'); ?>"> |
|
180 | 180 | </div> |
181 | 181 | |
182 | 182 | <div class="content feature-section-item last-feature"> |
183 | 183 | |
184 | - <h3><?php esc_html_e( 'Give - Democratizing Generosity', 'give' ); ?></h3> |
|
184 | + <h3><?php esc_html_e('Give - Democratizing Generosity', 'give'); ?></h3> |
|
185 | 185 | |
186 | - <p><?php esc_html_e( 'Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give' ); ?></p> |
|
186 | + <p><?php esc_html_e('Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give'); ?></p> |
|
187 | 187 | <a href="https://givewp.com" target="_blank" class="button-secondary"> |
188 | - <?php esc_html_e( 'Learn More', 'give' ); ?> |
|
188 | + <?php esc_html_e('Learn More', 'give'); ?> |
|
189 | 189 | <span class="dashicons dashicons-external"></span> |
190 | 190 | </a> |
191 | 191 | |
@@ -198,22 +198,22 @@ discard block |
||
198 | 198 | |
199 | 199 | <div class="content feature-section-item"> |
200 | 200 | |
201 | - <h3><?php esc_html_e( 'Getting to Know Give', 'give' ); ?></h3> |
|
201 | + <h3><?php esc_html_e('Getting to Know Give', 'give'); ?></h3> |
|
202 | 202 | |
203 | - <p><?php esc_html_e( 'Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have a question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give' ); ?></p> |
|
203 | + <p><?php esc_html_e('Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have a question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give'); ?></p> |
|
204 | 204 | |
205 | 205 | <h4>Find Out More:</h4> |
206 | 206 | <ul class="ul-disc"> |
207 | - <li><a href="https://givewp.com/" target="_blank"><?php esc_html_e( 'Visit the Give Website', 'give' ); ?></a></li> |
|
208 | - <li><a href="https://givewp.com/features/" target="_blank"><?php esc_html_e( 'View the Give Features', 'give' ); ?></a></li> |
|
209 | - <li><a href="https://givewp.com/documentation/" target="_blank"><?php esc_html_e( 'Read the Documentation', 'give' ); ?></a></li> |
|
207 | + <li><a href="https://givewp.com/" target="_blank"><?php esc_html_e('Visit the Give Website', 'give'); ?></a></li> |
|
208 | + <li><a href="https://givewp.com/features/" target="_blank"><?php esc_html_e('View the Give Features', 'give'); ?></a></li> |
|
209 | + <li><a href="https://givewp.com/documentation/" target="_blank"><?php esc_html_e('Read the Documentation', 'give'); ?></a></li> |
|
210 | 210 | </ul> |
211 | 211 | |
212 | 212 | </div> |
213 | 213 | |
214 | 214 | <div class="content feature-section-item last-feature"> |
215 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/dist/images/admin/give-form-mockup.png' ?>" |
|
216 | - alt="<?php esc_attr_e( 'A Give donation form', 'give' ); ?>"> |
|
215 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/dist/images/admin/give-form-mockup.png' ?>" |
|
216 | + alt="<?php esc_attr_e('A Give donation form', 'give'); ?>"> |
|
217 | 217 | </div> |
218 | 218 | |
219 | 219 | </div> |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | * @return void |
233 | 233 | */ |
234 | 234 | public function changelog_screen() { |
235 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
235 | + list($display_version) = explode('-', GIVE_VERSION); |
|
236 | 236 | ?> |
237 | 237 | <div class="wrap about-wrap"> |
238 | 238 | <h1><?php echo get_admin_page_title(); ?></h1> |
@@ -240,14 +240,14 @@ discard block |
||
240 | 240 | <p class="about-text"><?php |
241 | 241 | printf( |
242 | 242 | /* translators: %s: Give version */ |
243 | - esc_html__( 'Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give' ), |
|
243 | + esc_html__('Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give'), |
|
244 | 244 | $display_version |
245 | 245 | ); |
246 | 246 | ?></p> |
247 | 247 | <div class="give-badge"><?php |
248 | 248 | printf( |
249 | 249 | /* translators: %s: Give version */ |
250 | - esc_html__( 'Version %s', 'give' ), |
|
250 | + esc_html__('Version %s', 'give'), |
|
251 | 251 | $display_version |
252 | 252 | ); |
253 | 253 | ?></div> |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | <?php $this->tabs(); ?> |
256 | 256 | |
257 | 257 | <div class="changelog"> |
258 | - <h3><?php esc_html_e( 'Full Changelog', 'give' ); ?></h3> |
|
258 | + <h3><?php esc_html_e('Full Changelog', 'give'); ?></h3> |
|
259 | 259 | |
260 | 260 | <div class="feature-section"> |
261 | 261 | <?php echo $this->parse_readme(); ?> |
@@ -263,10 +263,10 @@ discard block |
||
263 | 263 | </div> |
264 | 264 | |
265 | 265 | <div class="return-to-dashboard"> |
266 | - <a href="<?php echo esc_url( admin_url( add_query_arg( array( |
|
266 | + <a href="<?php echo esc_url(admin_url(add_query_arg(array( |
|
267 | 267 | 'post_type' => 'give_forms', |
268 | 268 | 'page' => 'give-settings' |
269 | - ), 'edit.php' ) ) ); ?>"><?php esc_html_e( 'Give Settings', 'give' ); ?></a> |
|
269 | + ), 'edit.php'))); ?>"><?php esc_html_e('Give Settings', 'give'); ?></a> |
|
270 | 270 | </div> |
271 | 271 | </div> |
272 | 272 | <?php |
@@ -280,36 +280,36 @@ discard block |
||
280 | 280 | * @return void |
281 | 281 | */ |
282 | 282 | public function getting_started_screen() { |
283 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
283 | + list($display_version) = explode('-', GIVE_VERSION); |
|
284 | 284 | ?> |
285 | 285 | <div class="wrap about-wrap get-started"> |
286 | 286 | |
287 | 287 | <?php $this->get_welcome_header() ?> |
288 | 288 | |
289 | - <p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p> |
|
289 | + <p class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></p> |
|
290 | 290 | |
291 | 291 | <?php give_get_newsletter(); ?> |
292 | 292 | |
293 | 293 | <div class="give-badge"><?php |
294 | 294 | printf( |
295 | 295 | /* translators: %s: Give version */ |
296 | - esc_html__( 'Version %s', 'give' ), |
|
296 | + esc_html__('Version %s', 'give'), |
|
297 | 297 | $display_version |
298 | 298 | ); |
299 | 299 | ?></div> |
300 | 300 | |
301 | 301 | <?php $this->tabs(); ?> |
302 | 302 | |
303 | - <p class="about-text"><?php printf( esc_html__( 'Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give' ), $display_version ); ?></p> |
|
303 | + <p class="about-text"><?php printf(esc_html__('Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give'), $display_version); ?></p> |
|
304 | 304 | |
305 | 305 | <div class="feature-section clearfix"> |
306 | 306 | |
307 | 307 | <div class="content feature-section-item"> |
308 | - <h3><?php esc_html_e( 'STEP 1: Create a New Form', 'give' ); ?></h3> |
|
308 | + <h3><?php esc_html_e('STEP 1: Create a New Form', 'give'); ?></h3> |
|
309 | 309 | |
310 | - <p><?php esc_html_e( 'Give is driven by it\'s powerful donation form building features. However, it is much more than just a "donation form". From the "Add Form" page you\'ll be able to choose how and where you want to receive your donations. You will also be able to set the preferred donation amounts.', 'give' ); ?></p> |
|
310 | + <p><?php esc_html_e('Give is driven by it\'s powerful donation form building features. However, it is much more than just a "donation form". From the "Add Form" page you\'ll be able to choose how and where you want to receive your donations. You will also be able to set the preferred donation amounts.', 'give'); ?></p> |
|
311 | 311 | |
312 | - <p><?php esc_html_e( 'All of these features begin by simply going to the menu and choosing "Donations > Add Form".', 'give' ); ?></p> |
|
312 | + <p><?php esc_html_e('All of these features begin by simply going to the menu and choosing "Donations > Add Form".', 'give'); ?></p> |
|
313 | 313 | </div> |
314 | 314 | |
315 | 315 | <div class="content feature-section-item last-feature"> |
@@ -326,9 +326,9 @@ discard block |
||
326 | 326 | </div> |
327 | 327 | |
328 | 328 | <div class="content feature-section-item last-feature"> |
329 | - <h3><?php esc_html_e( 'STEP 2: Customize Your Donation Forms', 'give' ); ?></h3> |
|
329 | + <h3><?php esc_html_e('STEP 2: Customize Your Donation Forms', 'give'); ?></h3> |
|
330 | 330 | |
331 | - <p><?php esc_html_e( 'Each donation form you create can be customized to receive either a pre-determined set donation amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the donation levels view where you can add as many levels as you\'d like with your own custom names and suggested amounts. As well, you can allow donors to give a custom amount and even set up donation goals.', 'give' ); ?></p> |
|
331 | + <p><?php esc_html_e('Each donation form you create can be customized to receive either a pre-determined set donation amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the donation levels view where you can add as many levels as you\'d like with your own custom names and suggested amounts. As well, you can allow donors to give a custom amount and even set up donation goals.', 'give'); ?></p> |
|
332 | 332 | </div> |
333 | 333 | |
334 | 334 | </div> |
@@ -337,11 +337,11 @@ discard block |
||
337 | 337 | <div class="feature-section clearfix"> |
338 | 338 | |
339 | 339 | <div class="content feature-section-item add-content"> |
340 | - <h3><?php esc_html_e( 'STEP 3: Add Additional Content', 'give' ); ?></h3> |
|
340 | + <h3><?php esc_html_e('STEP 3: Add Additional Content', 'give'); ?></h3> |
|
341 | 341 | |
342 | - <p><?php esc_html_e( 'Every donation form you create with Give can be used on its own stand-alone page, or it can be inserted into any other page or post throughout your site via a shortcode or widget.', 'give' ); ?></p> |
|
342 | + <p><?php esc_html_e('Every donation form you create with Give can be used on its own stand-alone page, or it can be inserted into any other page or post throughout your site via a shortcode or widget.', 'give'); ?></p> |
|
343 | 343 | |
344 | - <p><?php esc_html_e( 'You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give' ); ?></p> |
|
344 | + <p><?php esc_html_e('You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give'); ?></p> |
|
345 | 345 | </div> |
346 | 346 | |
347 | 347 | <div class="content feature-section-item last-feature"> |
@@ -358,9 +358,9 @@ discard block |
||
358 | 358 | </div> |
359 | 359 | |
360 | 360 | <div class="content feature-section-item last-feature"> |
361 | - <h3><?php esc_html_e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3> |
|
361 | + <h3><?php esc_html_e('STEP 4: Configure Your Display Options', 'give'); ?></h3> |
|
362 | 362 | |
363 | - <p><?php esc_html_e( 'Lastly, you can present the form in a number of different ways that each create their own unique donor experience. The "Modal" display mode opens the credit card fieldset within a popup window. The "Reveal" mode will slide into place the additional fields. If you\'re looking for a simple button, then "Button" more is the way to go. This allows you to create a customizable "Donate Now" button which will open the donation form upon clicking. There\'s tons of possibilities here, give it a try!', 'give' ); ?></p> |
|
363 | + <p><?php esc_html_e('Lastly, you can present the form in a number of different ways that each create their own unique donor experience. The "Modal" display mode opens the credit card fieldset within a popup window. The "Reveal" mode will slide into place the additional fields. If you\'re looking for a simple button, then "Button" more is the way to go. This allows you to create a customizable "Donate Now" button which will open the donation form upon clicking. There\'s tons of possibilities here, give it a try!', 'give'); ?></p> |
|
364 | 364 | </div> |
365 | 365 | |
366 | 366 | |
@@ -380,20 +380,20 @@ discard block |
||
380 | 380 | * @return void |
381 | 381 | */ |
382 | 382 | public function credits_screen() { |
383 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
383 | + list($display_version) = explode('-', GIVE_VERSION); |
|
384 | 384 | ?> |
385 | 385 | <div class="wrap about-wrap"> |
386 | 386 | |
387 | 387 | <?php $this->get_welcome_header() ?> |
388 | 388 | |
389 | - <p class="about-text"><?php esc_html_e( 'Thanks to all those who have contributed code directly or indirectly.', 'give' ); ?></p> |
|
389 | + <p class="about-text"><?php esc_html_e('Thanks to all those who have contributed code directly or indirectly.', 'give'); ?></p> |
|
390 | 390 | |
391 | 391 | <?php give_get_newsletter(); ?> |
392 | 392 | |
393 | 393 | <div class="give-badge"><?php |
394 | 394 | printf( |
395 | 395 | /* translators: %s: Give version */ |
396 | - esc_html__( 'Version %s', 'give' ), |
|
396 | + esc_html__('Version %s', 'give'), |
|
397 | 397 | $display_version |
398 | 398 | ); |
399 | 399 | ?></div> |
@@ -403,8 +403,8 @@ discard block |
||
403 | 403 | <p class="about-description"><?php |
404 | 404 | printf( |
405 | 405 | /* translators: %s: https://github.com/WordImpress/give */ |
406 | - __( 'Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give' ), |
|
407 | - esc_url( 'https://github.com/WordImpress/give' ) |
|
406 | + __('Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give'), |
|
407 | + esc_url('https://github.com/WordImpress/give') |
|
408 | 408 | ); |
409 | 409 | ?></p> |
410 | 410 | |
@@ -421,21 +421,21 @@ discard block |
||
421 | 421 | * @return string $readme HTML formatted readme file |
422 | 422 | */ |
423 | 423 | public function parse_readme() { |
424 | - $file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null; |
|
424 | + $file = file_exists(GIVE_PLUGIN_DIR.'readme.txt') ? GIVE_PLUGIN_DIR . 'readme.txt' : null; |
|
425 | 425 | |
426 | - if ( ! $file ) { |
|
427 | - $readme = '<p>' . esc_html__( 'No valid changlog was found.', 'give' ) . '</p>'; |
|
426 | + if ( ! $file) { |
|
427 | + $readme = '<p>'.esc_html__('No valid changlog was found.', 'give').'</p>'; |
|
428 | 428 | } else { |
429 | - $readme = file_get_contents( $file ); |
|
430 | - $readme = nl2br( esc_html( $readme ) ); |
|
431 | - $readme = explode( '== Changelog ==', $readme ); |
|
432 | - $readme = end( $readme ); |
|
433 | - |
|
434 | - $readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme ); |
|
435 | - $readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme ); |
|
436 | - $readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme ); |
|
437 | - $readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme ); |
|
438 | - $readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme ); |
|
429 | + $readme = file_get_contents($file); |
|
430 | + $readme = nl2br(esc_html($readme)); |
|
431 | + $readme = explode('== Changelog ==', $readme); |
|
432 | + $readme = end($readme); |
|
433 | + |
|
434 | + $readme = preg_replace('/`(.*?)`/', '<code>\\1</code>', $readme); |
|
435 | + $readme = preg_replace('/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme); |
|
436 | + $readme = preg_replace('/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme); |
|
437 | + $readme = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $readme); |
|
438 | + $readme = preg_replace('/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | return $readme; |
@@ -452,24 +452,24 @@ discard block |
||
452 | 452 | public function contributors() { |
453 | 453 | $contributors = $this->get_contributors(); |
454 | 454 | |
455 | - if ( empty( $contributors ) ) { |
|
455 | + if (empty($contributors)) { |
|
456 | 456 | return ''; |
457 | 457 | } |
458 | 458 | |
459 | 459 | $contributor_list = '<ul class="wp-people-group">'; |
460 | 460 | |
461 | - foreach ( $contributors as $contributor ) { |
|
461 | + foreach ($contributors as $contributor) { |
|
462 | 462 | $contributor_list .= '<li class="wp-person">'; |
463 | 463 | $contributor_list .= sprintf( |
464 | 464 | '<a href="%1$s" target="_blank"><img src="%2$s" width="64" height="64" class="gravatar" alt="%3$s" /></a>', |
465 | - esc_url( 'https://github.com/' . $contributor->login ), |
|
466 | - esc_url( $contributor->avatar_url ), |
|
467 | - esc_attr( $contributor->login ) |
|
465 | + esc_url('https://github.com/'.$contributor->login), |
|
466 | + esc_url($contributor->avatar_url), |
|
467 | + esc_attr($contributor->login) |
|
468 | 468 | ); |
469 | 469 | $contributor_list .= sprintf( |
470 | 470 | '<a class="web" target="_blank" href="%1$s">%2$s</a>', |
471 | - esc_url( 'https://github.com/' . $contributor->login ), |
|
472 | - esc_html( $contributor->login ) |
|
471 | + esc_url('https://github.com/'.$contributor->login), |
|
472 | + esc_html($contributor->login) |
|
473 | 473 | ); |
474 | 474 | $contributor_list .= '</li>'; |
475 | 475 | } |
@@ -487,25 +487,25 @@ discard block |
||
487 | 487 | * @return array $contributors List of contributors |
488 | 488 | */ |
489 | 489 | public function get_contributors() { |
490 | - $contributors = Give_Cache::get( 'give_contributors', true ); |
|
490 | + $contributors = Give_Cache::get('give_contributors', true); |
|
491 | 491 | |
492 | - if ( false !== $contributors ) { |
|
492 | + if (false !== $contributors) { |
|
493 | 493 | return $contributors; |
494 | 494 | } |
495 | 495 | |
496 | - $response = wp_remote_get( 'https://api.github.com/repos/WordImpress/Give/contributors', array( 'sslverify' => false ) ); |
|
496 | + $response = wp_remote_get('https://api.github.com/repos/WordImpress/Give/contributors', array('sslverify' => false)); |
|
497 | 497 | |
498 | - if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) { |
|
498 | + if (is_wp_error($response) || 200 != wp_remote_retrieve_response_code($response)) { |
|
499 | 499 | return array(); |
500 | 500 | } |
501 | 501 | |
502 | - $contributors = json_decode( wp_remote_retrieve_body( $response ) ); |
|
502 | + $contributors = json_decode(wp_remote_retrieve_body($response)); |
|
503 | 503 | |
504 | - if ( ! is_array( $contributors ) ) { |
|
504 | + if ( ! is_array($contributors)) { |
|
505 | 505 | return array(); |
506 | 506 | } |
507 | 507 | |
508 | - Give_Cache::set( 'give_contributors', $contributors, HOUR_IN_SECONDS, true ); |
|
508 | + Give_Cache::set('give_contributors', $contributors, HOUR_IN_SECONDS, true); |
|
509 | 509 | |
510 | 510 | return $contributors; |
511 | 511 | } |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | */ |
518 | 518 | public function get_welcome_header() { |
519 | 519 | // Badge for welcome page |
520 | - $badge_url = GIVE_PLUGIN_URL . 'assets/dist/images/give-badge.png'; |
|
520 | + $badge_url = GIVE_PLUGIN_URL.'assets/dist/images/give-badge.png'; |
|
521 | 521 | ?> |
522 | 522 | <h1 class="welcome-h1"><?php echo get_admin_page_title(); ?></h1> |
523 | 523 | <?php $this->social_media_elements(); ?> |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | <a href="https://twitter.com/givewp" class="twitter-follow-button" data-show-count="false"><?php |
611 | 611 | printf( |
612 | 612 | /* translators: %s: Give twitter user @givewp */ |
613 | - esc_html_e( 'Follow %s', 'give' ), |
|
613 | + esc_html_e('Follow %s', 'give'), |
|
614 | 614 | '@givewp' |
615 | 615 | ); |
616 | 616 | ?></a> |
@@ -644,27 +644,27 @@ discard block |
||
644 | 644 | public function welcome() { |
645 | 645 | |
646 | 646 | // Bail if no activation redirect |
647 | - if ( ! Give_Cache::get( '_give_activation_redirect', true ) || wp_doing_ajax() ) { |
|
647 | + if ( ! Give_Cache::get('_give_activation_redirect', true) || wp_doing_ajax()) { |
|
648 | 648 | return; |
649 | 649 | } |
650 | 650 | |
651 | 651 | // Delete the redirect transient |
652 | - Give_Cache::delete( Give_Cache::get_key( '_give_activation_redirect' ) ); |
|
652 | + Give_Cache::delete(Give_Cache::get_key('_give_activation_redirect')); |
|
653 | 653 | |
654 | 654 | // Bail if activating from network, or bulk |
655 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
|
655 | + if (is_network_admin() || isset($_GET['activate-multi'])) { |
|
656 | 656 | return; |
657 | 657 | } |
658 | 658 | |
659 | - $upgrade = get_option( 'give_version_upgraded_from' ); |
|
659 | + $upgrade = get_option('give_version_upgraded_from'); |
|
660 | 660 | |
661 | - if ( ! $upgrade ) { // First time install |
|
662 | - wp_safe_redirect( admin_url( 'index.php?page=give-about' ) ); |
|
661 | + if ( ! $upgrade) { // First time install |
|
662 | + wp_safe_redirect(admin_url('index.php?page=give-about')); |
|
663 | 663 | exit; |
664 | - } elseif ( ! give_is_setting_enabled( give_get_option( 'welcome' ) ) ) { // Welcome is disabled in settings |
|
664 | + } elseif ( ! give_is_setting_enabled(give_get_option('welcome'))) { // Welcome is disabled in settings |
|
665 | 665 | |
666 | 666 | } else { // Welcome is NOT disabled in settings |
667 | - wp_safe_redirect( admin_url( 'index.php?page=give-about' ) ); |
|
667 | + wp_safe_redirect(admin_url('index.php?page=give-about')); |
|
668 | 668 | exit; |
669 | 669 | } |
670 | 670 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | |
11 | 11 | // Exit if accessed directly. |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; |
14 | 14 | } |
15 | 15 | |
@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function __construct() { |
25 | 25 | |
26 | - $this->shortcode['title'] = __( 'Give Totals', 'give' ); |
|
27 | - $this->shortcode['label'] = __( 'Give Totals', 'give' ); |
|
26 | + $this->shortcode['title'] = __('Give Totals', 'give'); |
|
27 | + $this->shortcode['label'] = __('Give Totals', 'give'); |
|
28 | 28 | |
29 | - parent::__construct( 'give_totals' ); |
|
29 | + parent::__construct('give_totals'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -39,66 +39,66 @@ discard block |
||
39 | 39 | |
40 | 40 | $category_options = array(); |
41 | 41 | $category_lists = array(); |
42 | - $categories = get_terms( 'give_forms_category', apply_filters( 'give_forms_category_dropdown', array() ) ); |
|
43 | - if ( give_is_setting_enabled( give_get_option( 'categories' ) ) && ! is_wp_error( $categories ) ) { |
|
44 | - foreach ( $categories as $category ) { |
|
45 | - $category_options[ absint( $category->term_id ) ] = esc_html( $category->name ); |
|
42 | + $categories = get_terms('give_forms_category', apply_filters('give_forms_category_dropdown', array())); |
|
43 | + if (give_is_setting_enabled(give_get_option('categories')) && ! is_wp_error($categories)) { |
|
44 | + foreach ($categories as $category) { |
|
45 | + $category_options[absint($category->term_id)] = esc_html($category->name); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | $category_lists['type'] = 'listbox'; |
49 | 49 | $category_lists['name'] = 'cats'; |
50 | - $category_lists['label'] = __( 'Select a Donation Form Category:', 'give' ); |
|
51 | - $category_lists['tooltip'] = __( 'Select a Donation Form Category', 'give' ); |
|
50 | + $category_lists['label'] = __('Select a Donation Form Category:', 'give'); |
|
51 | + $category_lists['tooltip'] = __('Select a Donation Form Category', 'give'); |
|
52 | 52 | $category_lists['options'] = $category_options; |
53 | 53 | } |
54 | 54 | |
55 | 55 | $tag_options = array(); |
56 | 56 | $tag_lists = array(); |
57 | - $tags = get_terms( 'give_forms_tag', apply_filters( 'give_forms_tag_dropdown', array() ) ); |
|
58 | - if ( give_is_setting_enabled( give_get_option( 'tags' ) ) && ! is_wp_error( $tags ) ) { |
|
59 | - $tags = get_terms( 'give_forms_tag', apply_filters( 'give_forms_tag_dropdown', array() ) ); |
|
60 | - foreach ( $tags as $tag ) { |
|
61 | - $tag_options[ absint( $tag->term_id ) ] = esc_html( $tag->name ); |
|
57 | + $tags = get_terms('give_forms_tag', apply_filters('give_forms_tag_dropdown', array())); |
|
58 | + if (give_is_setting_enabled(give_get_option('tags')) && ! is_wp_error($tags)) { |
|
59 | + $tags = get_terms('give_forms_tag', apply_filters('give_forms_tag_dropdown', array())); |
|
60 | + foreach ($tags as $tag) { |
|
61 | + $tag_options[absint($tag->term_id)] = esc_html($tag->name); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | $tag_lists['type'] = 'listbox'; |
65 | 65 | $tag_lists['name'] = 'tags'; |
66 | - $tag_lists['label'] = __( 'Select a Donation Form Tag:', 'give' ); |
|
67 | - $tag_lists['tooltip'] = __( 'Select a Donation Form Tag', 'give' ); |
|
66 | + $tag_lists['label'] = __('Select a Donation Form Tag:', 'give'); |
|
67 | + $tag_lists['tooltip'] = __('Select a Donation Form Tag', 'give'); |
|
68 | 68 | $tag_lists['options'] = $tag_options; |
69 | 69 | } |
70 | 70 | |
71 | 71 | return array( |
72 | 72 | array( |
73 | 73 | 'type' => 'container', |
74 | - 'html' => sprintf( '<p class="give-totals-shortcode-container-message">%s</p>', |
|
75 | - __( 'This shortcode shows the total amount raised towards a custom goal for one or several forms regardless of whether they have goals enabled or not.', 'give' ) |
|
74 | + 'html' => sprintf('<p class="give-totals-shortcode-container-message">%s</p>', |
|
75 | + __('This shortcode shows the total amount raised towards a custom goal for one or several forms regardless of whether they have goals enabled or not.', 'give') |
|
76 | 76 | ), |
77 | 77 | ), |
78 | 78 | array( |
79 | 79 | 'type' => 'container', |
80 | - 'html' => sprintf( '<p class="strong margin-top">%s</p>', __( 'Shortcode Configuration', 'give' ) ), |
|
80 | + 'html' => sprintf('<p class="strong margin-top">%s</p>', __('Shortcode Configuration', 'give')), |
|
81 | 81 | ), |
82 | 82 | array( |
83 | 83 | 'type' => 'textbox', |
84 | 84 | 'name' => 'ids', |
85 | - 'label' => __( 'Donation Form IDs:', 'give' ), |
|
86 | - 'tooltip' => __( 'Enter the IDs separated by commas for the donation forms you would like to combine within the totals.', 'give' ), |
|
85 | + 'label' => __('Donation Form IDs:', 'give'), |
|
86 | + 'tooltip' => __('Enter the IDs separated by commas for the donation forms you would like to combine within the totals.', 'give'), |
|
87 | 87 | ), |
88 | 88 | $category_lists, |
89 | 89 | $tag_lists, |
90 | 90 | array( |
91 | 91 | 'type' => 'textbox', |
92 | 92 | 'name' => 'total_goal', |
93 | - 'label' => __( 'Total Goal:', 'give' ), |
|
94 | - 'tooltip' => __( 'Enter the total goal amount that you would like to display.', 'give' ), |
|
93 | + 'label' => __('Total Goal:', 'give'), |
|
94 | + 'tooltip' => __('Enter the total goal amount that you would like to display.', 'give'), |
|
95 | 95 | ), |
96 | 96 | array( |
97 | 97 | 'type' => 'textbox', |
98 | 98 | 'name' => 'message', |
99 | - 'label' => __( 'Message:', 'give' ), |
|
100 | - 'tooltip' => __( 'Enter a message to display encouraging donors to support the goal.', 'give' ), |
|
101 | - 'value' => apply_filters( 'give_totals_message', __( 'Hey! We\'ve raised {total} of the {total_goal} we are trying to raise for this campaign!', 'give' ) ), |
|
99 | + 'label' => __('Message:', 'give'), |
|
100 | + 'tooltip' => __('Enter a message to display encouraging donors to support the goal.', 'give'), |
|
101 | + 'value' => apply_filters('give_totals_message', __('Hey! We\'ve raised {total} of the {total_goal} we are trying to raise for this campaign!', 'give')), |
|
102 | 102 | 'multiline' => true, |
103 | 103 | 'minWidth' => 300, |
104 | 104 | 'minHeight' => 60, |
@@ -106,24 +106,24 @@ discard block |
||
106 | 106 | array( |
107 | 107 | 'type' => 'textbox', |
108 | 108 | 'name' => 'link', |
109 | - 'label' => __( 'Link:', 'give' ), |
|
110 | - 'tooltip' => __( 'Enter a link to the main campaign donation form.', 'give' ), |
|
109 | + 'label' => __('Link:', 'give'), |
|
110 | + 'tooltip' => __('Enter a link to the main campaign donation form.', 'give'), |
|
111 | 111 | ), |
112 | 112 | array( |
113 | 113 | 'type' => 'textbox', |
114 | 114 | 'name' => 'link_text', |
115 | - 'label' => __( 'Link Text:', 'give' ), |
|
116 | - 'tooltip' => __( 'Enter hyperlink text for the link to the main campaign donation form.', 'give' ), |
|
117 | - 'value' => __( 'Donate!', 'give' ), |
|
115 | + 'label' => __('Link Text:', 'give'), |
|
116 | + 'tooltip' => __('Enter hyperlink text for the link to the main campaign donation form.', 'give'), |
|
117 | + 'value' => __('Donate!', 'give'), |
|
118 | 118 | ), |
119 | 119 | array( |
120 | 120 | 'type' => 'listbox', |
121 | 121 | 'name' => 'progress_bar', |
122 | - 'label' => __( 'Show Progress Bar:', 'give' ), |
|
123 | - 'tooltip' => __( 'Select whether you would like to show a goal progress bar.', 'give' ), |
|
122 | + 'label' => __('Show Progress Bar:', 'give'), |
|
123 | + 'tooltip' => __('Select whether you would like to show a goal progress bar.', 'give'), |
|
124 | 124 | 'options' => array( |
125 | - 'true' => __( 'Show', 'give' ), |
|
126 | - 'false' => __( 'Hide', 'give' ), |
|
125 | + 'true' => __('Show', 'give'), |
|
126 | + 'false' => __('Hide', 'give'), |
|
127 | 127 | ), |
128 | 128 | 'value' => 'true', |
129 | 129 | ), |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | |
14 | 14 | // Exit if accessed directly. |
15 | -if ( ! defined( 'ABSPATH' ) ) { |
|
15 | +if ( ! defined('ABSPATH')) { |
|
16 | 16 | exit; |
17 | 17 | } |
18 | 18 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * Class constructor |
33 | 33 | */ |
34 | 34 | public function __construct() { |
35 | - add_action( 'admin_init', array( $this, 'init'), 999 ); |
|
35 | + add_action('admin_init', array($this, 'init'), 999); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -41,17 +41,17 @@ discard block |
||
41 | 41 | * @since 2.1.0 |
42 | 42 | * @access public |
43 | 43 | */ |
44 | - public function init(){ |
|
45 | - if ( $this->is_add_button() ) { |
|
46 | - add_filter( 'mce_external_plugins', array( $this, 'mce_external_plugins' ), 15 ); |
|
44 | + public function init() { |
|
45 | + if ($this->is_add_button()) { |
|
46 | + add_filter('mce_external_plugins', array($this, 'mce_external_plugins'), 15); |
|
47 | 47 | |
48 | - add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_assets' ) ); |
|
49 | - add_action( 'admin_enqueue_scripts', array( $this, 'admin_localize_scripts' ), 13 ); |
|
50 | - add_action( 'media_buttons', array( $this, 'shortcode_button' ) ); |
|
48 | + add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_assets')); |
|
49 | + add_action('admin_enqueue_scripts', array($this, 'admin_localize_scripts'), 13); |
|
50 | + add_action('media_buttons', array($this, 'shortcode_button')); |
|
51 | 51 | } |
52 | 52 | |
53 | - add_action( "wp_ajax_give_shortcode", array( $this, 'shortcode_ajax' ) ); |
|
54 | - add_action( "wp_ajax_nopriv_give_shortcode", array( $this, 'shortcode_ajax' ) ); |
|
53 | + add_action("wp_ajax_give_shortcode", array($this, 'shortcode_ajax')); |
|
54 | + add_action("wp_ajax_nopriv_give_shortcode", array($this, 'shortcode_ajax')); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -63,13 +63,13 @@ discard block |
||
63 | 63 | * |
64 | 64 | * @since 1.0 |
65 | 65 | */ |
66 | - public function mce_external_plugins( $plugin_array ) { |
|
66 | + public function mce_external_plugins($plugin_array) { |
|
67 | 67 | |
68 | - if ( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) ) { |
|
68 | + if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages')) { |
|
69 | 69 | return false; |
70 | 70 | } |
71 | 71 | |
72 | - $plugin_array['give_shortcode'] = GIVE_PLUGIN_URL . 'includes/admin/shortcodes/mce-plugin.js'; |
|
72 | + $plugin_array['give_shortcode'] = GIVE_PLUGIN_URL.'includes/admin/shortcodes/mce-plugin.js'; |
|
73 | 73 | |
74 | 74 | return $plugin_array; |
75 | 75 | } |
@@ -82,19 +82,19 @@ discard block |
||
82 | 82 | * @since 1.0 |
83 | 83 | */ |
84 | 84 | public function admin_enqueue_assets() { |
85 | - $direction = ( is_rtl() || isset( $_GET['d'] ) && 'rtl' === $_GET['d'] ) ? '.rtl' : ''; |
|
85 | + $direction = (is_rtl() || isset($_GET['d']) && 'rtl' === $_GET['d']) ? '.rtl' : ''; |
|
86 | 86 | |
87 | 87 | wp_enqueue_script( |
88 | 88 | 'give_shortcode', |
89 | - GIVE_PLUGIN_URL . 'includes/admin/shortcodes/admin-shortcodes.js', |
|
90 | - array( 'jquery' ), |
|
89 | + GIVE_PLUGIN_URL.'includes/admin/shortcodes/admin-shortcodes.js', |
|
90 | + array('jquery'), |
|
91 | 91 | GIVE_VERSION, |
92 | 92 | true |
93 | 93 | ); |
94 | 94 | |
95 | 95 | wp_enqueue_style( |
96 | 96 | 'give-admin-shortcode-button-style', |
97 | - GIVE_PLUGIN_URL . 'assets/dist/css/admin-shortcode-button' . $direction . '.css', |
|
97 | + GIVE_PLUGIN_URL.'assets/dist/css/admin-shortcode-button'.$direction.'.css', |
|
98 | 98 | array(), |
99 | 99 | GIVE_VERSION |
100 | 100 | ); |
@@ -109,17 +109,17 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function admin_localize_scripts() { |
111 | 111 | |
112 | - if ( ! empty( self::$shortcodes ) ) { |
|
112 | + if ( ! empty(self::$shortcodes)) { |
|
113 | 113 | |
114 | 114 | $variables = array(); |
115 | 115 | |
116 | - foreach ( self::$shortcodes as $shortcode => $values ) { |
|
117 | - if ( ! empty( $values['required'] ) ) { |
|
118 | - $variables[ $shortcode ] = $values['required']; |
|
116 | + foreach (self::$shortcodes as $shortcode => $values) { |
|
117 | + if ( ! empty($values['required'])) { |
|
118 | + $variables[$shortcode] = $values['required']; |
|
119 | 119 | } |
120 | 120 | } |
121 | 121 | |
122 | - wp_localize_script( 'give_shortcode', 'scShortcodes', $variables ); |
|
122 | + wp_localize_script('give_shortcode', 'scShortcodes', $variables); |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | |
@@ -134,16 +134,16 @@ discard block |
||
134 | 134 | |
135 | 135 | $shortcodes = array(); |
136 | 136 | |
137 | - foreach ( self::$shortcodes as $shortcode => $values ) { |
|
137 | + foreach (self::$shortcodes as $shortcode => $values) { |
|
138 | 138 | |
139 | 139 | /** |
140 | 140 | * Filters the condition for including the current shortcode |
141 | 141 | * |
142 | 142 | * @since 1.0 |
143 | 143 | */ |
144 | - if ( apply_filters( sanitize_title( $shortcode ) . '_condition', true ) ) { |
|
144 | + if (apply_filters(sanitize_title($shortcode).'_condition', true)) { |
|
145 | 145 | |
146 | - $shortcodes[ $shortcode ] = sprintf( |
|
146 | + $shortcodes[$shortcode] = sprintf( |
|
147 | 147 | '<div class="sc-shortcode mce-menu-item give-shortcode-item-%1$s" data-shortcode="%2$s">%3$s</div>', |
148 | 148 | $shortcode, |
149 | 149 | $shortcode, |
@@ -152,37 +152,37 @@ discard block |
||
152 | 152 | } |
153 | 153 | } |
154 | 154 | |
155 | - if ( ! empty( $shortcodes ) ) { |
|
155 | + if ( ! empty($shortcodes)) { |
|
156 | 156 | |
157 | 157 | // check current WP version |
158 | - $img = ( version_compare( get_bloginfo( 'version' ), '3.5', '<' ) ) |
|
159 | - ? '<img src="' . GIVE_PLUGIN_URL . 'assets/dist/images/give-media.png" />' |
|
160 | - : '<span class="wp-media-buttons-icon" id="give-media-button" style="background-image: url(' . give_svg_icons( 'give_grey' ) . ');"></span>'; |
|
158 | + $img = (version_compare(get_bloginfo('version'), '3.5', '<')) |
|
159 | + ? '<img src="'.GIVE_PLUGIN_URL.'assets/dist/images/give-media.png" />' |
|
160 | + : '<span class="wp-media-buttons-icon" id="give-media-button" style="background-image: url('.give_svg_icons('give_grey').');"></span>'; |
|
161 | 161 | |
162 | - reset( $shortcodes ); |
|
162 | + reset($shortcodes); |
|
163 | 163 | |
164 | - if ( 1 === count( $shortcodes ) ) { |
|
164 | + if (1 === count($shortcodes)) { |
|
165 | 165 | |
166 | - $shortcode = key( $shortcodes ); |
|
166 | + $shortcode = key($shortcodes); |
|
167 | 167 | |
168 | 168 | printf( |
169 | 169 | '<button type="button" class="button sc-shortcode" data-shortcode="%s">%s</button>', |
170 | 170 | $shortcode, |
171 | - sprintf( '%s %s %s', |
|
171 | + sprintf('%s %s %s', |
|
172 | 172 | $img, |
173 | - __( 'Insert', 'give' ), |
|
174 | - self::$shortcodes[ $shortcode ]['label'] |
|
173 | + __('Insert', 'give'), |
|
174 | + self::$shortcodes[$shortcode]['label'] |
|
175 | 175 | ) |
176 | 176 | ); |
177 | 177 | } else { |
178 | 178 | printf( |
179 | - '<div class="sc-wrap">' . |
|
180 | - '<button class="button sc-button" type="button">%s %s</button>' . |
|
181 | - '<div class="sc-menu mce-menu">%s</div>' . |
|
179 | + '<div class="sc-wrap">'. |
|
180 | + '<button class="button sc-button" type="button">%s %s</button>'. |
|
181 | + '<div class="sc-menu mce-menu">%s</div>'. |
|
182 | 182 | '</div>', |
183 | 183 | $img, |
184 | - __( 'Give Shortcodes', 'give' ), |
|
185 | - implode( '', array_values( $shortcodes ) ) |
|
184 | + __('Give Shortcodes', 'give'), |
|
185 | + implode('', array_values($shortcodes)) |
|
186 | 186 | ); |
187 | 187 | } |
188 | 188 | } |
@@ -197,15 +197,15 @@ discard block |
||
197 | 197 | */ |
198 | 198 | public function shortcode_ajax() { |
199 | 199 | |
200 | - $shortcode = isset( $_POST['shortcode'] ) ? $_POST['shortcode'] : false; |
|
200 | + $shortcode = isset($_POST['shortcode']) ? $_POST['shortcode'] : false; |
|
201 | 201 | $response = false; |
202 | 202 | |
203 | - if ( $shortcode && array_key_exists( $shortcode, self::$shortcodes ) ) { |
|
203 | + if ($shortcode && array_key_exists($shortcode, self::$shortcodes)) { |
|
204 | 204 | |
205 | - $data = self::$shortcodes[ $shortcode ]; |
|
205 | + $data = self::$shortcodes[$shortcode]; |
|
206 | 206 | |
207 | - if ( ! empty( $data['errors'] ) ) { |
|
208 | - $data['btn_okay'] = array( esc_html__( 'Okay', 'give' ) ); |
|
207 | + if ( ! empty($data['errors'])) { |
|
208 | + $data['btn_okay'] = array(esc_html__('Okay', 'give')); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | $response = array( |
@@ -217,10 +217,10 @@ discard block |
||
217 | 217 | ); |
218 | 218 | } else { |
219 | 219 | // todo: handle error |
220 | - error_log( print_r( 'AJAX error!', 1 ) ); |
|
220 | + error_log(print_r('AJAX error!', 1)); |
|
221 | 221 | } |
222 | 222 | |
223 | - wp_send_json( $response ); |
|
223 | + wp_send_json($response); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | |
@@ -234,21 +234,21 @@ discard block |
||
234 | 234 | private function is_add_button() { |
235 | 235 | global $pagenow; |
236 | 236 | |
237 | - $shortcode_button_pages = apply_filters( 'give_shortcode_button_pages', array( |
|
237 | + $shortcode_button_pages = apply_filters('give_shortcode_button_pages', array( |
|
238 | 238 | 'post.php', |
239 | 239 | 'page.php', |
240 | 240 | 'post-new.php', |
241 | 241 | 'post-edit.php', |
242 | 242 | 'edit.php', |
243 | 243 | 'edit.php?post_type=page', |
244 | - ) ); |
|
244 | + )); |
|
245 | 245 | |
246 | 246 | // Only run in admin post/page creation and edit screens |
247 | 247 | if ( |
248 | 248 | ! is_admin() |
249 | - || ! in_array( $pagenow, $shortcode_button_pages ) |
|
250 | - || ! apply_filters( 'give_shortcode_button_condition', true ) |
|
251 | - || empty( self::$shortcodes ) |
|
249 | + || ! in_array($pagenow, $shortcode_button_pages) |
|
250 | + || ! apply_filters('give_shortcode_button_condition', true) |
|
251 | + || empty(self::$shortcodes) |
|
252 | 252 | ) { |
253 | 253 | return false; |
254 | 254 | } |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Settings_Page' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Page')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Page. |
@@ -70,25 +70,25 @@ discard block |
||
70 | 70 | // Get current setting page. |
71 | 71 | $this->current_setting_page = give_get_current_setting_page(); |
72 | 72 | |
73 | - add_filter( "give_default_setting_tab_section_{$this->id}", array( $this, 'set_default_setting_tab' ), 10 ); |
|
74 | - add_filter( "{$this->current_setting_page}_tabs_array", array( $this, 'add_settings_page' ), 20 ); |
|
75 | - add_action( "{$this->current_setting_page}_settings_{$this->id}_page", array( $this, 'output' ) ); |
|
73 | + add_filter("give_default_setting_tab_section_{$this->id}", array($this, 'set_default_setting_tab'), 10); |
|
74 | + add_filter("{$this->current_setting_page}_tabs_array", array($this, 'add_settings_page'), 20); |
|
75 | + add_action("{$this->current_setting_page}_settings_{$this->id}_page", array($this, 'output')); |
|
76 | 76 | |
77 | 77 | // Output section only if exist. |
78 | 78 | $sections = $this->get_sections(); |
79 | - if ( ! empty( $sections ) ) { |
|
80 | - add_action( "{$this->current_setting_page}_sections_{$this->id}_page", array( |
|
79 | + if ( ! empty($sections)) { |
|
80 | + add_action("{$this->current_setting_page}_sections_{$this->id}_page", array( |
|
81 | 81 | $this, |
82 | 82 | 'output_sections', |
83 | - ) ); |
|
83 | + )); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | // Save hide button by default. |
87 | 87 | $GLOBALS['give_hide_save_button'] = true; |
88 | 88 | |
89 | 89 | // Enable saving feature. |
90 | - if ( $this->enable_save ) { |
|
91 | - add_action( "{$this->current_setting_page}_save_{$this->id}", array( $this, 'save' ) ); |
|
90 | + if ($this->enable_save) { |
|
91 | + add_action("{$this->current_setting_page}_save_{$this->id}", array($this, 'save')); |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @return string |
115 | 115 | */ |
116 | - function set_default_setting_tab( $setting_tab ) { |
|
116 | + function set_default_setting_tab($setting_tab) { |
|
117 | 117 | return $this->default_tab; |
118 | 118 | } |
119 | 119 | |
@@ -126,8 +126,8 @@ discard block |
||
126 | 126 | * |
127 | 127 | * @return array |
128 | 128 | */ |
129 | - public function add_settings_page( $pages ) { |
|
130 | - $pages[ $this->id ] = $this->label; |
|
129 | + public function add_settings_page($pages) { |
|
130 | + $pages[$this->id] = $this->label; |
|
131 | 131 | |
132 | 132 | return $pages; |
133 | 133 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * |
147 | 147 | * @param array $settings |
148 | 148 | */ |
149 | - $settings = apply_filters( 'give_get_settings_' . $this->id, array() ); |
|
149 | + $settings = apply_filters('give_get_settings_'.$this->id, array()); |
|
150 | 150 | |
151 | 151 | // Output. |
152 | 152 | return $settings; |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * @return array |
160 | 160 | */ |
161 | 161 | public function get_sections() { |
162 | - return apply_filters( 'give_get_sections_' . $this->id, array() ); |
|
162 | + return apply_filters('give_get_sections_'.$this->id, array()); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
@@ -176,40 +176,40 @@ discard block |
||
176 | 176 | $sections = $this->get_sections(); |
177 | 177 | |
178 | 178 | // Bailout. |
179 | - if ( empty( $sections ) ) { |
|
179 | + if (empty($sections)) { |
|
180 | 180 | return; |
181 | 181 | } |
182 | 182 | |
183 | 183 | // Show section settings only if setting section exist. |
184 | - if ( $current_section && ! in_array( $current_section, array_keys( $sections ), true ) ) { |
|
185 | - echo wp_kses_post( '<div class="error"><p>' . __( 'Oops, this settings page does not exist.', 'give' ) . '</p></div>' ); |
|
184 | + if ($current_section && ! in_array($current_section, array_keys($sections), true)) { |
|
185 | + echo wp_kses_post('<div class="error"><p>'.__('Oops, this settings page does not exist.', 'give').'</p></div>'); |
|
186 | 186 | $GLOBALS['give_hide_save_button'] = true; |
187 | 187 | |
188 | 188 | return; |
189 | 189 | } |
190 | 190 | |
191 | - if ( is_null( $this->current_setting_page ) ) { |
|
191 | + if (is_null($this->current_setting_page)) { |
|
192 | 192 | $this->current_setting_page = give_get_current_setting_page(); |
193 | 193 | } |
194 | 194 | |
195 | 195 | $section_list = array(); |
196 | - foreach ( $sections as $id => $label ) { |
|
196 | + foreach ($sections as $id => $label) { |
|
197 | 197 | /** |
198 | 198 | * Fire the filter to hide particular section on tab. |
199 | 199 | * |
200 | 200 | * @since 2.0 |
201 | 201 | */ |
202 | - if ( apply_filters( "give_hide_section_{$id}_on_{$this->id}_page", false, $sections, $this->id ) ) { |
|
202 | + if (apply_filters("give_hide_section_{$id}_on_{$this->id}_page", false, $sections, $this->id)) { |
|
203 | 203 | continue; |
204 | 204 | } |
205 | 205 | |
206 | - $section_list[] = '<li><a href="' . admin_url( 'edit.php?post_type=give_forms&page=' . $this->current_setting_page . '&tab=' . $this->id . '§ion=' . sanitize_title( $id ) ) . '" class="' . ( $current_section === $id ? 'current' : '' ) . '">' . $label . '</a>'; |
|
206 | + $section_list[] = '<li><a href="'.admin_url('edit.php?post_type=give_forms&page='.$this->current_setting_page.'&tab='.$this->id.'§ion='.sanitize_title($id)).'" class="'.($current_section === $id ? 'current' : '').'">'.$label.'</a>'; |
|
207 | 207 | } |
208 | 208 | |
209 | - echo wp_kses_post( sprintf( |
|
209 | + echo wp_kses_post(sprintf( |
|
210 | 210 | '<ul class="subsubsub">%s</ul><br class="clear" /><hr>', |
211 | - implode( ' | </li>', $section_list ) |
|
212 | - ) ); |
|
211 | + implode(' | </li>', $section_list) |
|
212 | + )); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | /** |
@@ -221,13 +221,13 @@ discard block |
||
221 | 221 | * @return void |
222 | 222 | */ |
223 | 223 | public function output() { |
224 | - if ( $this->enable_save ) { |
|
224 | + if ($this->enable_save) { |
|
225 | 225 | $GLOBALS['give_hide_save_button'] = false; |
226 | 226 | } |
227 | 227 | |
228 | 228 | $settings = $this->get_settings(); |
229 | 229 | |
230 | - Give_Admin_Settings::output_fields( $settings, 'give_settings' ); |
|
230 | + Give_Admin_Settings::output_fields($settings, 'give_settings'); |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | /** |
@@ -245,8 +245,8 @@ discard block |
||
245 | 245 | * |
246 | 246 | * @since 2.1 |
247 | 247 | */ |
248 | - if ( apply_filters( "give_save_options_{$this->id}_{$current_section}", true ) ) { |
|
249 | - Give_Admin_Settings::save_fields( $settings, 'give_settings' ); |
|
248 | + if (apply_filters("give_save_options_{$this->id}_{$current_section}", true)) { |
|
249 | + Give_Admin_Settings::save_fields($settings, 'give_settings'); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | * |
255 | 255 | * @since 1.8 |
256 | 256 | */ |
257 | - do_action( 'give_update_options_' . $this->id . '_' . $current_section ); |
|
257 | + do_action('give_update_options_'.$this->id.'_'.$current_section); |
|
258 | 258 | } |
259 | 259 | |
260 | 260 | /** |
@@ -271,11 +271,11 @@ discard block |
||
271 | 271 | $section = $this->get_sections(); |
272 | 272 | $current_section = give_get_current_setting_section(); |
273 | 273 | |
274 | - if ( array_key_exists( $current_section, $section ) ) { |
|
275 | - $heading[] = $section[ $current_section ]; |
|
274 | + if (array_key_exists($current_section, $section)) { |
|
275 | + $heading[] = $section[$current_section]; |
|
276 | 276 | } |
277 | 277 | |
278 | - return array_unique( $heading ); |
|
278 | + return array_unique($heading); |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | /** |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | public function get_heading_html() { |
290 | 290 | return sprintf( |
291 | 291 | '<h1 class="wp-heading-inline">%s</h1><hr class="wp-header-end">', |
292 | - implode( ' <span class="give-settings-heading-sep dashicons dashicons-arrow-right-alt2"></span> ', $this->get_heading() ) |
|
292 | + implode(' <span class="give-settings-heading-sep dashicons dashicons-arrow-right-alt2"></span> ', $this->get_heading()) |
|
293 | 293 | ); |
294 | 294 | } |
295 | 295 | } |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | * @access public |
37 | 37 | */ |
38 | 38 | public function __construct() { |
39 | - parent::__construct( array( |
|
40 | - 'singular' => __( 'Give Email Notification', 'give' ), |
|
41 | - 'plural' => __( 'Give Email Notifications', 'give' ), |
|
42 | - ) ); |
|
39 | + parent::__construct(array( |
|
40 | + 'singular' => __('Give Email Notification', 'give'), |
|
41 | + 'plural' => __('Give Email Notifications', 'give'), |
|
42 | + )); |
|
43 | 43 | |
44 | 44 | $this->email_notifications = Give_Email_Notifications::get_instance(); |
45 | 45 | } |
@@ -59,13 +59,13 @@ discard block |
||
59 | 59 | * |
60 | 60 | * @since 2.0 |
61 | 61 | */ |
62 | - return apply_filters( 'give_email_notification_setting_columns', array( |
|
63 | - 'cb' => __( 'Email Status', 'give' ), |
|
64 | - 'name' => __( 'Email', 'give' ), |
|
65 | - 'email_type' => __( 'Content Type', 'give' ), |
|
66 | - 'recipient' => __( 'Recipient(s)', 'give' ), |
|
67 | - 'setting' => __( 'Edit Email', 'give' ), |
|
68 | - ) ); |
|
62 | + return apply_filters('give_email_notification_setting_columns', array( |
|
63 | + 'cb' => __('Email Status', 'give'), |
|
64 | + 'name' => __('Email', 'give'), |
|
65 | + 'email_type' => __('Content Type', 'give'), |
|
66 | + 'recipient' => __('Recipient(s)', 'give'), |
|
67 | + 'setting' => __('Edit Email', 'give'), |
|
68 | + )); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -78,19 +78,19 @@ discard block |
||
78 | 78 | * |
79 | 79 | * @return string |
80 | 80 | */ |
81 | - public function column_name( $email ) { |
|
82 | - $edit_url = esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=emails§ion=' . $email->config['id'] ) ); |
|
83 | - $actions = $this->get_row_actions( $email ); |
|
81 | + public function column_name($email) { |
|
82 | + $edit_url = esc_url(admin_url('edit.php?post_type=give_forms&page=give-settings&tab=emails§ion='.$email->config['id'])); |
|
83 | + $actions = $this->get_row_actions($email); |
|
84 | 84 | |
85 | 85 | ob_start(); |
86 | 86 | ?> |
87 | 87 | <a class="row-title" href="<?php echo $edit_url; ?>"><?php echo $email->config['label']; ?></a> |
88 | 88 | |
89 | - <?php if ( $desc = $email->config['description'] ) : ?> |
|
90 | - <?php echo Give()->tooltips->render_help( esc_attr( $desc ) ); ?> |
|
89 | + <?php if ($desc = $email->config['description']) : ?> |
|
90 | + <?php echo Give()->tooltips->render_help(esc_attr($desc)); ?> |
|
91 | 91 | <?php endif; ?> |
92 | 92 | |
93 | - <?php echo $this->row_actions( $actions ); ?> |
|
93 | + <?php echo $this->row_actions($actions); ?> |
|
94 | 94 | <?php |
95 | 95 | return ob_get_clean(); |
96 | 96 | } |
@@ -105,18 +105,18 @@ discard block |
||
105 | 105 | * |
106 | 106 | * @return string |
107 | 107 | */ |
108 | - public function column_recipient( $email ) { |
|
108 | + public function column_recipient($email) { |
|
109 | 109 | ob_start(); |
110 | 110 | |
111 | - if( Give_Email_Notification_Util::has_recipient_field( $email ) ) { |
|
111 | + if (Give_Email_Notification_Util::has_recipient_field($email)) { |
|
112 | 112 | $recipients = $email->get_recipient(); |
113 | - if ( is_array( $recipients ) ) { |
|
114 | - $recipients = implode( '<br>', $recipients ); |
|
113 | + if (is_array($recipients)) { |
|
114 | + $recipients = implode('<br>', $recipients); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | echo $recipients; |
118 | 118 | |
119 | - } elseif ( ! empty( $email->config['recipient_group_name'] ) ) { |
|
119 | + } elseif ( ! empty($email->config['recipient_group_name'])) { |
|
120 | 120 | echo $email->config['recipient_group_name']; |
121 | 121 | } |
122 | 122 | |
@@ -133,10 +133,10 @@ discard block |
||
133 | 133 | * |
134 | 134 | * @return string |
135 | 135 | */ |
136 | - public function column_cb( $email ) { |
|
136 | + public function column_cb($email) { |
|
137 | 137 | $notification_status = $email->get_notification_status(); |
138 | - $user_can_edit_status = (int) Give_Email_Notification_Util::is_notification_status_editable( $email ); |
|
139 | - $icon_classes = Give_Email_Notification_Util::is_email_notification_active( $email ) |
|
138 | + $user_can_edit_status = (int) Give_Email_Notification_Util::is_notification_status_editable($email); |
|
139 | + $icon_classes = Give_Email_Notification_Util::is_email_notification_active($email) |
|
140 | 140 | ? 'dashicons dashicons-yes' |
141 | 141 | : 'dashicons dashicons-no-alt'; |
142 | 142 | $attributes = array( |
@@ -146,15 +146,15 @@ discard block |
||
146 | 146 | 'data-edit' => $user_can_edit_status, |
147 | 147 | ); |
148 | 148 | |
149 | - if ( ! $user_can_edit_status ) { |
|
150 | - $icon_classes = 'dashicons dashicons-lock'; |
|
149 | + if ( ! $user_can_edit_status) { |
|
150 | + $icon_classes = 'dashicons dashicons-lock'; |
|
151 | 151 | |
152 | - $attributes['data-notice'] = esc_attr( $email->config['notices']['non-notification-status-editable'] ); |
|
152 | + $attributes['data-notice'] = esc_attr($email->config['notices']['non-notification-status-editable']); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | $html = sprintf( |
156 | 156 | '<span %1$s><i class="%2$s"></i></span></span><span class="spinner"></span>', |
157 | - give_get_attribute_str( $attributes ), |
|
157 | + give_get_attribute_str($attributes), |
|
158 | 158 | $icon_classes |
159 | 159 | ); |
160 | 160 | |
@@ -172,8 +172,8 @@ discard block |
||
172 | 172 | * |
173 | 173 | * @return string |
174 | 174 | */ |
175 | - public function column_email_type( Give_Email_Notification $email ) { |
|
176 | - return Give_Email_Notification_Util::get_formatted_email_type( $email->config['content_type'] ); |
|
175 | + public function column_email_type(Give_Email_Notification $email) { |
|
176 | + return Give_Email_Notification_Util::get_formatted_email_type($email->config['content_type']); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | /** |
@@ -186,15 +186,15 @@ discard block |
||
186 | 186 | * |
187 | 187 | * @return string |
188 | 188 | */ |
189 | - public function column_setting( Give_Email_Notification $email ) { |
|
190 | - return Give()->tooltips->render_link( array( |
|
191 | - 'label' => __( 'Edit', 'give' ) . " {$email->config['label']}", |
|
189 | + public function column_setting(Give_Email_Notification $email) { |
|
190 | + return Give()->tooltips->render_link(array( |
|
191 | + 'label' => __('Edit', 'give')." {$email->config['label']}", |
|
192 | 192 | 'tag_content' => '<span class="dashicons dashicons-admin-generic"></span>', |
193 | - 'link' => esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=emails§ion=' . $email->config['id'] ) ), |
|
193 | + 'link' => esc_url(admin_url('edit.php?post_type=give_forms&page=give-settings&tab=emails§ion='.$email->config['id'])), |
|
194 | 194 | 'attributes' => array( |
195 | 195 | 'class' => 'button button-small', |
196 | 196 | ), |
197 | - ) ); |
|
197 | + )); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | |
@@ -208,8 +208,8 @@ discard block |
||
208 | 208 | * |
209 | 209 | * @return array |
210 | 210 | */ |
211 | - private function get_row_actions( $email ) { |
|
212 | - $edit_url = esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=emails§ion=' . $email->config['id'] ) ); |
|
211 | + private function get_row_actions($email) { |
|
212 | + $edit_url = esc_url(admin_url('edit.php?post_type=give_forms&page=give-settings&tab=emails§ion='.$email->config['id'])); |
|
213 | 213 | |
214 | 214 | /** |
215 | 215 | * Filter the row actions |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $row_actions = apply_filters( |
222 | 222 | 'give_email_notification_row_actions', |
223 | 223 | array( |
224 | - 'edit' => "<a href=\"{$edit_url}\">" . __( 'Edit', 'give' ) . '</a>', |
|
224 | + 'edit' => "<a href=\"{$edit_url}\">".__('Edit', 'give').'</a>', |
|
225 | 225 | ), |
226 | 226 | |
227 | 227 | ); |
@@ -242,22 +242,22 @@ discard block |
||
242 | 242 | $hidden = array(); |
243 | 243 | $email_notifications = array(); |
244 | 244 | $sortable = $this->get_sortable_columns(); |
245 | - $this->_column_headers = array( $columns, $hidden, $sortable, $this->get_primary_column_name() ); |
|
245 | + $this->_column_headers = array($columns, $hidden, $sortable, $this->get_primary_column_name()); |
|
246 | 246 | |
247 | 247 | // Set email notifications. |
248 | 248 | /* @var Give_Email_Notification $email_notification */ |
249 | - foreach ( $this->email_notifications->get_email_notifications() as $email_notification ) { |
|
250 | - if ( Give_Email_Notification_Util::is_show_on_emails_setting_page( $email_notification ) ) { |
|
249 | + foreach ($this->email_notifications->get_email_notifications() as $email_notification) { |
|
250 | + if (Give_Email_Notification_Util::is_show_on_emails_setting_page($email_notification)) { |
|
251 | 251 | $email_notifications[] = $email_notification; |
252 | 252 | } |
253 | 253 | } |
254 | 254 | |
255 | - $totalItems = count( $email_notifications ); |
|
255 | + $totalItems = count($email_notifications); |
|
256 | 256 | $this->items = $email_notifications; |
257 | - $this->set_pagination_args( array( |
|
257 | + $this->set_pagination_args(array( |
|
258 | 258 | 'total_items' => $totalItems, |
259 | 259 | 'per_page' => $this->per_page, |
260 | - ) ); |
|
260 | + )); |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | /** |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | * @access public |
268 | 268 | */ |
269 | 269 | public function no_items() { |
270 | - _e( 'No give email notification found.', 'give' ); |
|
270 | + _e('No give email notification found.', 'give'); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | /** |
@@ -21,30 +21,30 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @return array |
23 | 23 | */ |
24 | - public static function get_setting_fields( Give_Email_Notification $email, $form_id = null ) { |
|
25 | - $setting_fields = self::get_default_setting_fields( $email, $form_id ); |
|
24 | + public static function get_setting_fields(Give_Email_Notification $email, $form_id = null) { |
|
25 | + $setting_fields = self::get_default_setting_fields($email, $form_id); |
|
26 | 26 | |
27 | 27 | // Recipient field. |
28 | - $setting_fields[] = self::get_recipient_setting_field( $email, $form_id, Give_Email_Notification_Util::has_recipient_field( $email ) ); |
|
28 | + $setting_fields[] = self::get_recipient_setting_field($email, $form_id, Give_Email_Notification_Util::has_recipient_field($email)); |
|
29 | 29 | |
30 | 30 | // Add extra setting field. |
31 | - if ( $extra_setting_field = $email->get_extra_setting_fields( $form_id ) ) { |
|
32 | - $setting_fields = array_merge( $setting_fields, $extra_setting_field ); |
|
31 | + if ($extra_setting_field = $email->get_extra_setting_fields($form_id)) { |
|
32 | + $setting_fields = array_merge($setting_fields, $extra_setting_field); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | // Preview field. |
36 | - if ( Give_Email_Notification_Util::has_preview( $email ) ) { |
|
37 | - $setting_fields[] = self::get_preview_setting_field( $email, $form_id ); |
|
36 | + if (Give_Email_Notification_Util::has_preview($email)) { |
|
37 | + $setting_fields[] = self::get_preview_setting_field($email, $form_id); |
|
38 | 38 | } |
39 | 39 | |
40 | - $setting_fields = self::add_section_end( $email, $setting_fields ); |
|
40 | + $setting_fields = self::add_section_end($email, $setting_fields); |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * Filter the email notification settings. |
44 | 44 | * |
45 | 45 | * @since 2.0 |
46 | 46 | */ |
47 | - return apply_filters( 'give_email_notification_setting_fields', $setting_fields, $email, $form_id ); |
|
47 | + return apply_filters('give_email_notification_setting_fields', $setting_fields, $email, $form_id); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | |
@@ -58,11 +58,11 @@ discard block |
||
58 | 58 | * |
59 | 59 | * @return bool |
60 | 60 | */ |
61 | - public static function has_section_end( $setting ) { |
|
62 | - $last_field = end( $setting ); |
|
61 | + public static function has_section_end($setting) { |
|
62 | + $last_field = end($setting); |
|
63 | 63 | $has_section_end = false; |
64 | 64 | |
65 | - if ( 'sectionend' === $last_field['type'] ) { |
|
65 | + if ('sectionend' === $last_field['type']) { |
|
66 | 66 | $has_section_end = true; |
67 | 67 | } |
68 | 68 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @return array |
82 | 82 | */ |
83 | - public static function get_section_start( Give_Email_Notification $email, $form_id = null ) { |
|
83 | + public static function get_section_start(Give_Email_Notification $email, $form_id = null) { |
|
84 | 84 | // Add section end field. |
85 | 85 | $setting = array( |
86 | 86 | 'id' => "give_title_email_settings_{$email->config['id']}", |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | * |
103 | 103 | * @return array |
104 | 104 | */ |
105 | - public static function add_section_end( Give_Email_Notification $email, $setting ) { |
|
106 | - if ( ! self::has_section_end( $setting ) ) { |
|
105 | + public static function add_section_end(Give_Email_Notification $email, $setting) { |
|
106 | + if ( ! self::has_section_end($setting)) { |
|
107 | 107 | // Add section end field. |
108 | 108 | $setting[] = array( |
109 | 109 | 'id' => "give_title_email_settings_{$email->config['id']}", |
@@ -125,25 +125,25 @@ discard block |
||
125 | 125 | * |
126 | 126 | * @return array |
127 | 127 | */ |
128 | - public static function get_default_setting_fields( Give_Email_Notification $email, $form_id = null ) { |
|
129 | - $settings[] = self::get_section_start( $email, $form_id ); |
|
130 | - $settings[] = self::get_notification_status_field( $email, $form_id ); |
|
128 | + public static function get_default_setting_fields(Give_Email_Notification $email, $form_id = null) { |
|
129 | + $settings[] = self::get_section_start($email, $form_id); |
|
130 | + $settings[] = self::get_notification_status_field($email, $form_id); |
|
131 | 131 | |
132 | - if ( ! Give_Email_Notification_Util::is_notification_status_editable( $email ) ) { |
|
133 | - if ( $form_id || give_is_add_new_form_page() ) { |
|
132 | + if ( ! Give_Email_Notification_Util::is_notification_status_editable($email)) { |
|
133 | + if ($form_id || give_is_add_new_form_page()) { |
|
134 | 134 | // Do not allow admin to disable notification on perform basis. |
135 | - unset( $settings[1]['options']['disabled'] ); |
|
135 | + unset($settings[1]['options']['disabled']); |
|
136 | 136 | } else { |
137 | 137 | // Do not allow admin to edit notification status globally. |
138 | - unset( $settings[1] ); |
|
138 | + unset($settings[1]); |
|
139 | 139 | } |
140 | 140 | } |
141 | 141 | |
142 | - $settings[] = self::get_email_subject_field( $email, $form_id ); |
|
143 | - $settings[] = self::get_email_message_field( $email, $form_id ); |
|
142 | + $settings[] = self::get_email_subject_field($email, $form_id); |
|
143 | + $settings[] = self::get_email_message_field($email, $form_id); |
|
144 | 144 | |
145 | - if ( Give_Email_Notification_Util::is_content_type_editable( $email ) ) { |
|
146 | - $settings[] = self::get_email_content_type_field( $email, $form_id ); |
|
145 | + if (Give_Email_Notification_Util::is_content_type_editable($email)) { |
|
146 | + $settings[] = self::get_email_content_type_field($email, $form_id); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | return $settings; |
@@ -160,31 +160,31 @@ discard block |
||
160 | 160 | * |
161 | 161 | * @return array |
162 | 162 | */ |
163 | - public static function get_notification_status_field( Give_Email_Notification $email, $form_id = null ) { |
|
163 | + public static function get_notification_status_field(Give_Email_Notification $email, $form_id = null) { |
|
164 | 164 | $option = array( |
165 | - 'enabled' => __( 'Enabled', 'give' ), |
|
166 | - 'disabled' => __( 'Disabled', 'give' ), |
|
165 | + 'enabled' => __('Enabled', 'give'), |
|
166 | + 'disabled' => __('Disabled', 'give'), |
|
167 | 167 | ); |
168 | 168 | |
169 | 169 | $default_value = $email->get_notification_status(); |
170 | 170 | |
171 | 171 | // Add global options. |
172 | - if ( $form_id || give_is_add_new_form_page() ) { |
|
172 | + if ($form_id || give_is_add_new_form_page()) { |
|
173 | 173 | $option = array( |
174 | - 'global' => __( 'Global Options' ), |
|
175 | - 'enabled' => __( 'Customize', 'give' ), |
|
176 | - 'disabled' => __( 'Disabled', 'give' ), |
|
174 | + 'global' => __('Global Options'), |
|
175 | + 'enabled' => __('Customize', 'give'), |
|
176 | + 'disabled' => __('Disabled', 'give'), |
|
177 | 177 | ); |
178 | 178 | |
179 | 179 | $default_value = 'global'; |
180 | 180 | } |
181 | 181 | |
182 | - $description = isset( $_GET['page'] ) && 'give-settings' === $_GET['page'] ? __( 'Choose whether you want this email enabled or not.', 'give' ) : sprintf( __( 'Global Options are set <a href="%s">in Give settings</a>. You may override them for this form here.', 'give' ), admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=emails' ) ); |
|
182 | + $description = isset($_GET['page']) && 'give-settings' === $_GET['page'] ? __('Choose whether you want this email enabled or not.', 'give') : sprintf(__('Global Options are set <a href="%s">in Give settings</a>. You may override them for this form here.', 'give'), admin_url('edit.php?post_type=give_forms&page=give-settings&tab=emails')); |
|
183 | 183 | |
184 | 184 | return array( |
185 | - 'name' => esc_html__( 'Notification', 'give' ), |
|
185 | + 'name' => esc_html__('Notification', 'give'), |
|
186 | 186 | 'desc' => $description, |
187 | - 'id' => self::get_prefix( $email, $form_id ) . 'notification', |
|
187 | + 'id' => self::get_prefix($email, $form_id).'notification', |
|
188 | 188 | 'type' => 'radio_inline', |
189 | 189 | 'default' => $default_value, |
190 | 190 | 'options' => $option, |
@@ -203,11 +203,11 @@ discard block |
||
203 | 203 | * |
204 | 204 | * @return array |
205 | 205 | */ |
206 | - public static function get_email_subject_field( Give_Email_Notification $email, $form_id = null ) { |
|
206 | + public static function get_email_subject_field(Give_Email_Notification $email, $form_id = null) { |
|
207 | 207 | return array( |
208 | - 'id' => self::get_prefix( $email, $form_id ) . 'email_subject', |
|
209 | - 'name' => esc_html__( 'Email Subject', 'give' ), |
|
210 | - 'desc' => esc_html__( 'Enter the email subject line.', 'give' ), |
|
208 | + 'id' => self::get_prefix($email, $form_id).'email_subject', |
|
209 | + 'name' => esc_html__('Email Subject', 'give'), |
|
210 | + 'desc' => esc_html__('Enter the email subject line.', 'give'), |
|
211 | 211 | 'default' => $email->config['default_email_subject'], |
212 | 212 | 'type' => 'text', |
213 | 213 | ); |
@@ -224,28 +224,28 @@ discard block |
||
224 | 224 | * |
225 | 225 | * @return array |
226 | 226 | */ |
227 | - public static function get_email_message_field( Give_Email_Notification $email, $form_id = null ) { |
|
228 | - $desc = esc_html__( 'Enter the email message.', 'give' ); |
|
227 | + public static function get_email_message_field(Give_Email_Notification $email, $form_id = null) { |
|
228 | + $desc = esc_html__('Enter the email message.', 'give'); |
|
229 | 229 | |
230 | - if ( $email_tag_list = $email->get_allowed_email_tags( true ) ) { |
|
230 | + if ($email_tag_list = $email->get_allowed_email_tags(true)) { |
|
231 | 231 | $desc = sprintf( |
232 | 232 | '%1$s <br> %2$s: %3$s %4$s', |
233 | - __( 'The email that is sent to users after completing a successful donation. HTML is accepted.', 'give' ), |
|
234 | - __( 'Available template tags', 'give' ), |
|
233 | + __('The email that is sent to users after completing a successful donation. HTML is accepted.', 'give'), |
|
234 | + __('Available template tags', 'give'), |
|
235 | 235 | $email_tag_list, |
236 | 236 | sprintf( |
237 | 237 | '<br><a href="%1$s" target="_blank">%2$s</a> %3$s', |
238 | - esc_url( 'http://docs.givewp.com/meta-email-tags' ), |
|
239 | - __( 'See our documentation', 'give' ), |
|
240 | - __( 'for examples of how to use custom meta email tags to output additional donor or donation information in your Give emails.', 'give' ) |
|
238 | + esc_url('http://docs.givewp.com/meta-email-tags'), |
|
239 | + __('See our documentation', 'give'), |
|
240 | + __('for examples of how to use custom meta email tags to output additional donor or donation information in your Give emails.', 'give') |
|
241 | 241 | ) |
242 | 242 | ); |
243 | 243 | |
244 | 244 | } |
245 | 245 | |
246 | 246 | return array( |
247 | - 'id' => self::get_prefix( $email, $form_id ) . 'email_message', |
|
248 | - 'name' => esc_html__( 'Email message', 'give' ), |
|
247 | + 'id' => self::get_prefix($email, $form_id).'email_message', |
|
248 | + 'name' => esc_html__('Email message', 'give'), |
|
249 | 249 | 'desc' => $desc, |
250 | 250 | 'type' => 'wysiwyg', |
251 | 251 | 'default' => $email->config['default_email_message'], |
@@ -263,15 +263,15 @@ discard block |
||
263 | 263 | * |
264 | 264 | * @return array |
265 | 265 | */ |
266 | - public static function get_email_content_type_field( Give_Email_Notification $email, $form_id = null ) { |
|
266 | + public static function get_email_content_type_field(Give_Email_Notification $email, $form_id = null) { |
|
267 | 267 | return array( |
268 | - 'id' => self::get_prefix( $email, $form_id ) . 'email_content_type', |
|
269 | - 'name' => esc_html__( 'Email Content Type', 'give' ), |
|
270 | - 'desc' => __( 'Choose email type.', 'give' ), |
|
268 | + 'id' => self::get_prefix($email, $form_id).'email_content_type', |
|
269 | + 'name' => esc_html__('Email Content Type', 'give'), |
|
270 | + 'desc' => __('Choose email type.', 'give'), |
|
271 | 271 | 'type' => 'select', |
272 | 272 | 'options' => array( |
273 | - 'text/html' => Give_Email_Notification_Util::get_formatted_email_type( 'text/html' ), |
|
274 | - 'text/plain' => Give_Email_Notification_Util::get_formatted_email_type( 'text/plain' ), |
|
273 | + 'text/html' => Give_Email_Notification_Util::get_formatted_email_type('text/html'), |
|
274 | + 'text/plain' => Give_Email_Notification_Util::get_formatted_email_type('text/plain'), |
|
275 | 275 | ), |
276 | 276 | 'default' => $email->config['content_type'], |
277 | 277 | ); |
@@ -291,29 +291,29 @@ discard block |
||
291 | 291 | * |
292 | 292 | * @return array |
293 | 293 | */ |
294 | - public static function get_recipient_setting_field( Give_Email_Notification $email, $form_id = null, $edit_recipient = true ) { |
|
294 | + public static function get_recipient_setting_field(Give_Email_Notification $email, $form_id = null, $edit_recipient = true) { |
|
295 | 295 | $recipient = array( |
296 | - 'id' => self::get_prefix( $email, $form_id ) . 'recipient', |
|
297 | - 'name' => esc_html__( 'Email Recipients', 'give' ), |
|
298 | - 'desc' => __( 'Enter the email address(es) that should receive a notification.', 'give' ), |
|
296 | + 'id' => self::get_prefix($email, $form_id).'recipient', |
|
297 | + 'name' => esc_html__('Email Recipients', 'give'), |
|
298 | + 'desc' => __('Enter the email address(es) that should receive a notification.', 'give'), |
|
299 | 299 | 'type' => 'email', |
300 | - 'default' => get_bloginfo( 'admin_email' ), |
|
300 | + 'default' => get_bloginfo('admin_email'), |
|
301 | 301 | 'repeat' => true, |
302 | - 'repeat_btn_title' => esc_html__( 'Add Recipient', 'give' ), |
|
302 | + 'repeat_btn_title' => esc_html__('Add Recipient', 'give'), |
|
303 | 303 | ); |
304 | 304 | |
305 | - if ( $form_id || give_is_add_new_form_page() ) { |
|
306 | - $recipient['name'] = __( 'Email', 'give' ); |
|
305 | + if ($form_id || give_is_add_new_form_page()) { |
|
306 | + $recipient['name'] = __('Email', 'give'); |
|
307 | 307 | $recipient['default'] = ''; |
308 | 308 | $recipient['id'] = 'email'; |
309 | - $recipient['desc'] = __( 'Enter the email address that should receive a notification.', 'give' ); |
|
309 | + $recipient['desc'] = __('Enter the email address that should receive a notification.', 'give'); |
|
310 | 310 | |
311 | 311 | $recipient = array( |
312 | - 'id' => self::get_prefix( $email, $form_id ) . 'recipient', |
|
312 | + 'id' => self::get_prefix($email, $form_id).'recipient', |
|
313 | 313 | 'type' => 'group', |
314 | 314 | 'options' => array( |
315 | - 'add_button' => __( 'Add Email', 'give' ), |
|
316 | - 'header_title' => __( 'Email Recipient', 'give' ), |
|
315 | + 'add_button' => __('Add Email', 'give'), |
|
316 | + 'header_title' => __('Email Recipient', 'give'), |
|
317 | 317 | 'remove_button' => '<span class="dashicons dashicons-no"></span>', |
318 | 318 | ), |
319 | 319 | 'fields' => array( |
@@ -324,16 +324,16 @@ discard block |
||
324 | 324 | |
325 | 325 | // Disable field if email donor has recipient field. |
326 | 326 | // @see https://github.com/WordImpress/Give/issues/2657 |
327 | - if ( ! $edit_recipient ) { |
|
328 | - if ( 'group' == $recipient['type'] ) { |
|
329 | - $recipient = current( $recipient['fields'] ); |
|
327 | + if ( ! $edit_recipient) { |
|
328 | + if ('group' == $recipient['type']) { |
|
329 | + $recipient = current($recipient['fields']); |
|
330 | 330 | $recipient['type'] = 'text'; |
331 | 331 | } |
332 | 332 | |
333 | 333 | $recipient['attributes']['disabled'] = 'disabled'; |
334 | 334 | $recipient['value'] = $recipient['default'] = '{donor_email}'; |
335 | 335 | $recipient['repeat'] = false; |
336 | - $recipient['desc'] = __( 'This email is automatically sent to the donor and the recipient cannot be customized.', 'give' ); |
|
336 | + $recipient['desc'] = __('This email is automatically sent to the donor and the recipient cannot be customized.', 'give'); |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | return $recipient; |
@@ -350,12 +350,12 @@ discard block |
||
350 | 350 | * |
351 | 351 | * @return array |
352 | 352 | */ |
353 | - public static function get_preview_setting_field( Give_Email_Notification $email, $form_id = null ) { |
|
353 | + public static function get_preview_setting_field(Give_Email_Notification $email, $form_id = null) { |
|
354 | 354 | return array( |
355 | - 'name' => __( 'Preview Email', 'give' ), |
|
356 | - 'desc' => __( 'Click the "Preview Email" button to preview the email in your browser. Click the "Send Test Email" button to send a test email directly to your inbox.', |
|
357 | - 'give' ), |
|
358 | - 'id' => self::get_prefix( $email, $form_id ) . 'preview_buttons', |
|
355 | + 'name' => __('Preview Email', 'give'), |
|
356 | + 'desc' => __('Click the "Preview Email" button to preview the email in your browser. Click the "Send Test Email" button to send a test email directly to your inbox.', |
|
357 | + 'give'), |
|
358 | + 'id' => self::get_prefix($email, $form_id).'preview_buttons', |
|
359 | 359 | 'type' => 'email_preview_buttons', |
360 | 360 | ); |
361 | 361 | } |
@@ -372,10 +372,10 @@ discard block |
||
372 | 372 | * |
373 | 373 | * @return string |
374 | 374 | */ |
375 | - public static function get_prefix( Give_Email_Notification $email, $form_id = null ) { |
|
375 | + public static function get_prefix(Give_Email_Notification $email, $form_id = null) { |
|
376 | 376 | $meta_key = "{$email->config['id']}_"; |
377 | 377 | |
378 | - if ( $form_id || give_is_add_new_form_page() ) { |
|
378 | + if ($form_id || give_is_add_new_form_page()) { |
|
379 | 379 | $meta_key = "_give_{$email->config['id']}_"; |
380 | 380 | } |
381 | 381 |