@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly. |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -23,36 +23,36 @@ discard block |
||
23 | 23 | function give_setup_post_types() { |
24 | 24 | |
25 | 25 | // Give Forms single post and archive options. |
26 | - $give_forms_singular = give_is_setting_enabled( give_get_option( 'forms_singular' ) ); |
|
27 | - $give_forms_archives = give_is_setting_enabled( give_get_option( 'forms_archives' ) ); |
|
26 | + $give_forms_singular = give_is_setting_enabled(give_get_option('forms_singular')); |
|
27 | + $give_forms_archives = give_is_setting_enabled(give_get_option('forms_archives')); |
|
28 | 28 | |
29 | - $give_forms_slug = defined( 'GIVE_SLUG' ) ? GIVE_SLUG : 'donations'; |
|
29 | + $give_forms_slug = defined('GIVE_SLUG') ? GIVE_SLUG : 'donations'; |
|
30 | 30 | // Support for old 'GIVE_FORMS_SLUG' constant |
31 | - if ( defined( 'GIVE_FORMS_SLUG' ) ) { |
|
31 | + if (defined('GIVE_FORMS_SLUG')) { |
|
32 | 32 | $give_forms_slug = GIVE_FORMS_SLUG; |
33 | 33 | } |
34 | 34 | |
35 | - $give_forms_rewrite = defined( 'GIVE_DISABLE_FORMS_REWRITE' ) && GIVE_DISABLE_FORMS_REWRITE ? false : array( |
|
35 | + $give_forms_rewrite = defined('GIVE_DISABLE_FORMS_REWRITE') && GIVE_DISABLE_FORMS_REWRITE ? false : array( |
|
36 | 36 | 'slug' => $give_forms_slug, |
37 | 37 | 'with_front' => false, |
38 | 38 | ); |
39 | 39 | |
40 | - $give_forms_labels = apply_filters( 'give_forms_labels', array( |
|
41 | - 'name' => __( 'Donation Forms', 'give' ), |
|
42 | - 'singular_name' => __( 'Form', 'give' ), |
|
43 | - 'add_new' => __( 'Add Form', 'give' ), |
|
44 | - 'add_new_item' => __( 'Add New Donation Form', 'give' ), |
|
45 | - 'edit_item' => __( 'Edit Donation Form', 'give' ), |
|
46 | - 'new_item' => __( 'New Form', 'give' ), |
|
47 | - 'all_items' => __( 'All Forms', 'give' ), |
|
48 | - 'view_item' => __( 'View Form', 'give' ), |
|
49 | - 'search_items' => __( 'Search Forms', 'give' ), |
|
50 | - 'not_found' => __( 'No forms found.', 'give' ), |
|
51 | - 'not_found_in_trash' => __( 'No forms found in Trash.', 'give' ), |
|
40 | + $give_forms_labels = apply_filters('give_forms_labels', array( |
|
41 | + 'name' => __('Donation Forms', 'give'), |
|
42 | + 'singular_name' => __('Form', 'give'), |
|
43 | + 'add_new' => __('Add Form', 'give'), |
|
44 | + 'add_new_item' => __('Add New Donation Form', 'give'), |
|
45 | + 'edit_item' => __('Edit Donation Form', 'give'), |
|
46 | + 'new_item' => __('New Form', 'give'), |
|
47 | + 'all_items' => __('All Forms', 'give'), |
|
48 | + 'view_item' => __('View Form', 'give'), |
|
49 | + 'search_items' => __('Search Forms', 'give'), |
|
50 | + 'not_found' => __('No forms found.', 'give'), |
|
51 | + 'not_found_in_trash' => __('No forms found in Trash.', 'give'), |
|
52 | 52 | 'parent_item_colon' => '', |
53 | - 'menu_name' => apply_filters( 'give_menu_name', __( 'Donations', 'give' ) ), |
|
54 | - 'name_admin_bar' => apply_filters( 'give_name_admin_bar_name', __( 'Donation Form', 'give' ) ), |
|
55 | - ) ); |
|
53 | + 'menu_name' => apply_filters('give_menu_name', __('Donations', 'give')), |
|
54 | + 'name_admin_bar' => apply_filters('give_name_admin_bar_name', __('Donation Form', 'give')), |
|
55 | + )); |
|
56 | 56 | |
57 | 57 | // Default give_forms supports. |
58 | 58 | $give_form_supports = array( |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | ); |
65 | 65 | |
66 | 66 | // Has the user disabled the excerpt? |
67 | - if ( ! give_is_setting_enabled( give_get_option( 'forms_excerpt' ) ) ) { |
|
68 | - unset( $give_form_supports[2] ); |
|
67 | + if ( ! give_is_setting_enabled(give_get_option('forms_excerpt'))) { |
|
68 | + unset($give_form_supports[2]); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | // Has user disabled the featured image? |
72 | - if ( ! give_is_setting_enabled( give_get_option( 'form_featured_img' ) ) ) { |
|
73 | - unset( $give_form_supports[1] ); |
|
74 | - remove_action( 'give_before_single_form_summary', 'give_show_form_images' ); |
|
72 | + if ( ! give_is_setting_enabled(give_get_option('form_featured_img'))) { |
|
73 | + unset($give_form_supports[1]); |
|
74 | + remove_action('give_before_single_form_summary', 'give_show_form_images'); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $give_forms_args = array( |
@@ -87,42 +87,42 @@ discard block |
||
87 | 87 | 'has_archive' => $give_forms_archives, |
88 | 88 | 'menu_icon' => 'dashicons-give', |
89 | 89 | 'hierarchical' => false, |
90 | - 'supports' => apply_filters( 'give_forms_supports', $give_form_supports ), |
|
90 | + 'supports' => apply_filters('give_forms_supports', $give_form_supports), |
|
91 | 91 | ); |
92 | - register_post_type( 'give_forms', apply_filters( 'give_forms_post_type_args', $give_forms_args ) ); |
|
92 | + register_post_type('give_forms', apply_filters('give_forms_post_type_args', $give_forms_args)); |
|
93 | 93 | |
94 | 94 | /** Donation Post Type */ |
95 | 95 | $payment_labels = array( |
96 | - 'name' => _x( 'Donations', 'post type general name', 'give' ), |
|
97 | - 'singular_name' => _x( 'Donation', 'post type singular name', 'give' ), |
|
98 | - 'add_new' => __( 'Add New', 'give' ), |
|
99 | - 'add_new_item' => __( 'Add New Donation', 'give' ), |
|
100 | - 'edit_item' => __( 'Edit Donation', 'give' ), |
|
101 | - 'new_item' => __( 'New Donation', 'give' ), |
|
102 | - 'all_items' => __( 'All Donations', 'give' ), |
|
103 | - 'view_item' => __( 'View Donation', 'give' ), |
|
104 | - 'search_items' => __( 'Search Donations', 'give' ), |
|
105 | - 'not_found' => __( 'No donations found.', 'give' ), |
|
106 | - 'not_found_in_trash' => __( 'No donations found in Trash.', 'give' ), |
|
96 | + 'name' => _x('Donations', 'post type general name', 'give'), |
|
97 | + 'singular_name' => _x('Donation', 'post type singular name', 'give'), |
|
98 | + 'add_new' => __('Add New', 'give'), |
|
99 | + 'add_new_item' => __('Add New Donation', 'give'), |
|
100 | + 'edit_item' => __('Edit Donation', 'give'), |
|
101 | + 'new_item' => __('New Donation', 'give'), |
|
102 | + 'all_items' => __('All Donations', 'give'), |
|
103 | + 'view_item' => __('View Donation', 'give'), |
|
104 | + 'search_items' => __('Search Donations', 'give'), |
|
105 | + 'not_found' => __('No donations found.', 'give'), |
|
106 | + 'not_found_in_trash' => __('No donations found in Trash.', 'give'), |
|
107 | 107 | 'parent_item_colon' => '', |
108 | - 'menu_name' => __( 'Donations', 'give' ), |
|
108 | + 'menu_name' => __('Donations', 'give'), |
|
109 | 109 | ); |
110 | 110 | |
111 | 111 | $payment_args = array( |
112 | - 'labels' => apply_filters( 'give_payment_labels', $payment_labels ), |
|
112 | + 'labels' => apply_filters('give_payment_labels', $payment_labels), |
|
113 | 113 | 'public' => false, |
114 | 114 | 'query_var' => false, |
115 | 115 | 'rewrite' => false, |
116 | 116 | 'map_meta_cap' => true, |
117 | 117 | 'capability_type' => 'give_payment', |
118 | - 'supports' => array( 'title' ), |
|
118 | + 'supports' => array('title'), |
|
119 | 119 | 'can_export' => true, |
120 | 120 | ); |
121 | - register_post_type( 'give_payment', $payment_args ); |
|
121 | + register_post_type('give_payment', $payment_args); |
|
122 | 122 | |
123 | 123 | } |
124 | 124 | |
125 | -add_action( 'init', 'give_setup_post_types', 1 ); |
|
125 | +add_action('init', 'give_setup_post_types', 1); |
|
126 | 126 | |
127 | 127 | |
128 | 128 | /** |
@@ -135,30 +135,30 @@ discard block |
||
135 | 135 | */ |
136 | 136 | function give_setup_taxonomies() { |
137 | 137 | |
138 | - $slug = defined( 'GIVE_FORMS_SLUG' ) ? GIVE_FORMS_SLUG : 'donations'; |
|
138 | + $slug = defined('GIVE_FORMS_SLUG') ? GIVE_FORMS_SLUG : 'donations'; |
|
139 | 139 | |
140 | 140 | /** Categories */ |
141 | 141 | $category_labels = array( |
142 | - 'name' => _x( 'Form Categories', 'taxonomy general name', 'give' ), |
|
143 | - 'singular_name' => _x( 'Category', 'taxonomy singular name', 'give' ), |
|
144 | - 'search_items' => __( 'Search Categories', 'give' ), |
|
145 | - 'all_items' => __( 'All Categories', 'give' ), |
|
146 | - 'parent_item' => __( 'Parent Category', 'give' ), |
|
147 | - 'parent_item_colon' => __( 'Parent Category:', 'give' ), |
|
148 | - 'edit_item' => __( 'Edit Category', 'give' ), |
|
149 | - 'update_item' => __( 'Update Category', 'give' ), |
|
150 | - 'add_new_item' => __( 'Add New Category', 'give' ), |
|
151 | - 'new_item_name' => __( 'New Category Name', 'give' ), |
|
152 | - 'menu_name' => __( 'Categories', 'give' ), |
|
142 | + 'name' => _x('Form Categories', 'taxonomy general name', 'give'), |
|
143 | + 'singular_name' => _x('Category', 'taxonomy singular name', 'give'), |
|
144 | + 'search_items' => __('Search Categories', 'give'), |
|
145 | + 'all_items' => __('All Categories', 'give'), |
|
146 | + 'parent_item' => __('Parent Category', 'give'), |
|
147 | + 'parent_item_colon' => __('Parent Category:', 'give'), |
|
148 | + 'edit_item' => __('Edit Category', 'give'), |
|
149 | + 'update_item' => __('Update Category', 'give'), |
|
150 | + 'add_new_item' => __('Add New Category', 'give'), |
|
151 | + 'new_item_name' => __('New Category Name', 'give'), |
|
152 | + 'menu_name' => __('Categories', 'give'), |
|
153 | 153 | ); |
154 | 154 | |
155 | - $category_args = apply_filters( 'give_forms_category_args', array( |
|
155 | + $category_args = apply_filters('give_forms_category_args', array( |
|
156 | 156 | 'hierarchical' => true, |
157 | - 'labels' => apply_filters( 'give_forms_category_labels', $category_labels ), |
|
157 | + 'labels' => apply_filters('give_forms_category_labels', $category_labels), |
|
158 | 158 | 'show_ui' => true, |
159 | 159 | 'query_var' => 'give_forms_category', |
160 | 160 | 'rewrite' => array( |
161 | - 'slug' => $slug . '/category', |
|
161 | + 'slug' => $slug.'/category', |
|
162 | 162 | 'with_front' => false, |
163 | 163 | 'hierarchical' => true, |
164 | 164 | ), |
@@ -172,33 +172,33 @@ discard block |
||
172 | 172 | ); |
173 | 173 | |
174 | 174 | // Does the user want categories? |
175 | - if ( give_is_setting_enabled( give_get_option( 'categories', 'disabled' ) ) ) { |
|
176 | - register_taxonomy( 'give_forms_category', array( 'give_forms' ), $category_args ); |
|
177 | - register_taxonomy_for_object_type( 'give_forms_category', 'give_forms' ); |
|
175 | + if (give_is_setting_enabled(give_get_option('categories', 'disabled'))) { |
|
176 | + register_taxonomy('give_forms_category', array('give_forms'), $category_args); |
|
177 | + register_taxonomy_for_object_type('give_forms_category', 'give_forms'); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | /** Tags */ |
181 | 181 | $tag_labels = array( |
182 | - 'name' => _x( 'Form Tags', 'taxonomy general name', 'give' ), |
|
183 | - 'singular_name' => _x( 'Tag', 'taxonomy singular name', 'give' ), |
|
184 | - 'search_items' => __( 'Search Tags', 'give' ), |
|
185 | - 'all_items' => __( 'All Tags', 'give' ), |
|
186 | - 'parent_item' => __( 'Parent Tag', 'give' ), |
|
187 | - 'parent_item_colon' => __( 'Parent Tag:', 'give' ), |
|
188 | - 'edit_item' => __( 'Edit Tag', 'give' ), |
|
189 | - 'update_item' => __( 'Update Tag', 'give' ), |
|
190 | - 'add_new_item' => __( 'Add New Tag', 'give' ), |
|
191 | - 'new_item_name' => __( 'New Tag Name', 'give' ), |
|
192 | - 'menu_name' => __( 'Tags', 'give' ), |
|
193 | - 'choose_from_most_used' => __( 'Choose from most used tags.', 'give' ), |
|
182 | + 'name' => _x('Form Tags', 'taxonomy general name', 'give'), |
|
183 | + 'singular_name' => _x('Tag', 'taxonomy singular name', 'give'), |
|
184 | + 'search_items' => __('Search Tags', 'give'), |
|
185 | + 'all_items' => __('All Tags', 'give'), |
|
186 | + 'parent_item' => __('Parent Tag', 'give'), |
|
187 | + 'parent_item_colon' => __('Parent Tag:', 'give'), |
|
188 | + 'edit_item' => __('Edit Tag', 'give'), |
|
189 | + 'update_item' => __('Update Tag', 'give'), |
|
190 | + 'add_new_item' => __('Add New Tag', 'give'), |
|
191 | + 'new_item_name' => __('New Tag Name', 'give'), |
|
192 | + 'menu_name' => __('Tags', 'give'), |
|
193 | + 'choose_from_most_used' => __('Choose from most used tags.', 'give'), |
|
194 | 194 | ); |
195 | 195 | |
196 | - $tag_args = apply_filters( 'give_forms_tag_args', array( |
|
196 | + $tag_args = apply_filters('give_forms_tag_args', array( |
|
197 | 197 | 'hierarchical' => false, |
198 | - 'labels' => apply_filters( 'give_forms_tag_labels', $tag_labels ), |
|
198 | + 'labels' => apply_filters('give_forms_tag_labels', $tag_labels), |
|
199 | 199 | 'show_ui' => true, |
200 | 200 | 'query_var' => 'give_forms_tag', |
201 | - 'rewrite' => array( 'slug' => $slug . '/tag', 'with_front' => false, 'hierarchical' => true ), |
|
201 | + 'rewrite' => array('slug' => $slug.'/tag', 'with_front' => false, 'hierarchical' => true), |
|
202 | 202 | 'capabilities' => array( |
203 | 203 | 'manage_terms' => 'manage_give_form_terms', |
204 | 204 | 'edit_terms' => 'edit_give_form_terms', |
@@ -208,14 +208,14 @@ discard block |
||
208 | 208 | ) |
209 | 209 | ); |
210 | 210 | |
211 | - if ( give_is_setting_enabled( give_get_option( 'tags', 'disabled' ) ) ) { |
|
212 | - register_taxonomy( 'give_forms_tag', array( 'give_forms' ), $tag_args ); |
|
213 | - register_taxonomy_for_object_type( 'give_forms_tag', 'give_forms' ); |
|
211 | + if (give_is_setting_enabled(give_get_option('tags', 'disabled'))) { |
|
212 | + register_taxonomy('give_forms_tag', array('give_forms'), $tag_args); |
|
213 | + register_taxonomy_for_object_type('give_forms_tag', 'give_forms'); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | } |
217 | 217 | |
218 | -add_action( 'init', 'give_setup_taxonomies', 0 ); |
|
218 | +add_action('init', 'give_setup_taxonomies', 0); |
|
219 | 219 | |
220 | 220 | |
221 | 221 | /** |
@@ -226,11 +226,11 @@ discard block |
||
226 | 226 | */ |
227 | 227 | function give_get_default_form_labels() { |
228 | 228 | $defaults = array( |
229 | - 'singular' => __( 'Form', 'give' ), |
|
230 | - 'plural' => __( 'Forms', 'give' ), |
|
229 | + 'singular' => __('Form', 'give'), |
|
230 | + 'plural' => __('Forms', 'give'), |
|
231 | 231 | ); |
232 | 232 | |
233 | - return apply_filters( 'give_default_form_name', $defaults ); |
|
233 | + return apply_filters('give_default_form_name', $defaults); |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | /** |
@@ -242,10 +242,10 @@ discard block |
||
242 | 242 | * |
243 | 243 | * @return string $defaults['singular'] Singular label |
244 | 244 | */ |
245 | -function give_get_forms_label_singular( $lowercase = false ) { |
|
245 | +function give_get_forms_label_singular($lowercase = false) { |
|
246 | 246 | $defaults = give_get_default_form_labels(); |
247 | 247 | |
248 | - return ( $lowercase ) ? strtolower( $defaults['singular'] ) : $defaults['singular']; |
|
248 | + return ($lowercase) ? strtolower($defaults['singular']) : $defaults['singular']; |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | /** |
@@ -254,10 +254,10 @@ discard block |
||
254 | 254 | * @since 1.0 |
255 | 255 | * @return string $defaults['plural'] Plural label |
256 | 256 | */ |
257 | -function give_get_forms_label_plural( $lowercase = false ) { |
|
257 | +function give_get_forms_label_plural($lowercase = false) { |
|
258 | 258 | $defaults = give_get_default_form_labels(); |
259 | 259 | |
260 | - return ( $lowercase ) ? strtolower( $defaults['plural'] ) : $defaults['plural']; |
|
260 | + return ($lowercase) ? strtolower($defaults['plural']) : $defaults['plural']; |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | /** |
@@ -269,24 +269,24 @@ discard block |
||
269 | 269 | * |
270 | 270 | * @return string $title New placeholder text |
271 | 271 | */ |
272 | -function give_change_default_title( $title ) { |
|
272 | +function give_change_default_title($title) { |
|
273 | 273 | // If a frontend plugin uses this filter (check extensions before changing this function) |
274 | - if ( ! is_admin() ) { |
|
275 | - $title = __( 'Enter form title here', 'give' ); |
|
274 | + if ( ! is_admin()) { |
|
275 | + $title = __('Enter form title here', 'give'); |
|
276 | 276 | |
277 | 277 | return $title; |
278 | 278 | } |
279 | 279 | |
280 | 280 | $screen = get_current_screen(); |
281 | 281 | |
282 | - if ( 'give_forms' == $screen->post_type ) { |
|
283 | - $title = __( 'Enter form title here', 'give' ); |
|
282 | + if ('give_forms' == $screen->post_type) { |
|
283 | + $title = __('Enter form title here', 'give'); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | return $title; |
287 | 287 | } |
288 | 288 | |
289 | -add_filter( 'enter_title_here', 'give_change_default_title' ); |
|
289 | +add_filter('enter_title_here', 'give_change_default_title'); |
|
290 | 290 | |
291 | 291 | /** |
292 | 292 | * Registers Custom Post Statuses which are used by the Payments |
@@ -296,58 +296,58 @@ discard block |
||
296 | 296 | */ |
297 | 297 | function give_register_post_type_statuses() { |
298 | 298 | // Payment Statuses |
299 | - register_post_status( 'refunded', array( |
|
300 | - 'label' => __( 'Refunded', 'give' ), |
|
299 | + register_post_status('refunded', array( |
|
300 | + 'label' => __('Refunded', 'give'), |
|
301 | 301 | 'public' => true, |
302 | 302 | 'exclude_from_search' => false, |
303 | 303 | 'show_in_admin_all_list' => true, |
304 | 304 | 'show_in_admin_status_list' => true, |
305 | - 'label_count' => _n_noop( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'give' ), |
|
306 | - ) ); |
|
307 | - register_post_status( 'failed', array( |
|
308 | - 'label' => __( 'Failed', 'give' ), |
|
305 | + 'label_count' => _n_noop('Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'give'), |
|
306 | + )); |
|
307 | + register_post_status('failed', array( |
|
308 | + 'label' => __('Failed', 'give'), |
|
309 | 309 | 'public' => true, |
310 | 310 | 'exclude_from_search' => false, |
311 | 311 | 'show_in_admin_all_list' => true, |
312 | 312 | 'show_in_admin_status_list' => true, |
313 | - 'label_count' => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'give' ), |
|
314 | - ) ); |
|
315 | - register_post_status( 'revoked', array( |
|
316 | - 'label' => __( 'Revoked', 'give' ), |
|
313 | + 'label_count' => _n_noop('Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'give'), |
|
314 | + )); |
|
315 | + register_post_status('revoked', array( |
|
316 | + 'label' => __('Revoked', 'give'), |
|
317 | 317 | 'public' => true, |
318 | 318 | 'exclude_from_search' => false, |
319 | 319 | 'show_in_admin_all_list' => true, |
320 | 320 | 'show_in_admin_status_list' => true, |
321 | - 'label_count' => _n_noop( 'Revoked <span class="count">(%s)</span>', 'Revoked <span class="count">(%s)</span>', 'give' ), |
|
322 | - ) ); |
|
323 | - register_post_status( 'cancelled', array( |
|
324 | - 'label' => __( 'Cancelled', 'give' ), |
|
321 | + 'label_count' => _n_noop('Revoked <span class="count">(%s)</span>', 'Revoked <span class="count">(%s)</span>', 'give'), |
|
322 | + )); |
|
323 | + register_post_status('cancelled', array( |
|
324 | + 'label' => __('Cancelled', 'give'), |
|
325 | 325 | 'public' => true, |
326 | 326 | 'exclude_from_search' => false, |
327 | 327 | 'show_in_admin_all_list' => true, |
328 | 328 | 'show_in_admin_status_list' => true, |
329 | - 'label_count' => _n_noop( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'give' ), |
|
330 | - ) ); |
|
331 | - register_post_status( 'abandoned', array( |
|
332 | - 'label' => __( 'Abandoned', 'give' ), |
|
329 | + 'label_count' => _n_noop('Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'give'), |
|
330 | + )); |
|
331 | + register_post_status('abandoned', array( |
|
332 | + 'label' => __('Abandoned', 'give'), |
|
333 | 333 | 'public' => true, |
334 | 334 | 'exclude_from_search' => false, |
335 | 335 | 'show_in_admin_all_list' => true, |
336 | 336 | 'show_in_admin_status_list' => true, |
337 | - 'label_count' => _n_noop( 'Abandoned <span class="count">(%s)</span>', 'Abandoned <span class="count">(%s)</span>', 'give' ), |
|
338 | - ) ); |
|
339 | - register_post_status( 'processing', array( |
|
340 | - 'label' => _x( 'Processing', 'Processing payment status', 'give' ), |
|
337 | + 'label_count' => _n_noop('Abandoned <span class="count">(%s)</span>', 'Abandoned <span class="count">(%s)</span>', 'give'), |
|
338 | + )); |
|
339 | + register_post_status('processing', array( |
|
340 | + 'label' => _x('Processing', 'Processing payment status', 'give'), |
|
341 | 341 | 'public' => true, |
342 | 342 | 'exclude_from_search' => false, |
343 | 343 | 'show_in_admin_all_list' => true, |
344 | 344 | 'show_in_admin_status_list' => true, |
345 | - 'label_count' => _n_noop( 'Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'give' ) |
|
346 | - ) ); |
|
345 | + 'label_count' => _n_noop('Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'give') |
|
346 | + )); |
|
347 | 347 | |
348 | 348 | } |
349 | 349 | |
350 | -add_action( 'init', 'give_register_post_type_statuses' ); |
|
350 | +add_action('init', 'give_register_post_type_statuses'); |
|
351 | 351 | |
352 | 352 | /** |
353 | 353 | * Updated Messages |
@@ -360,27 +360,27 @@ discard block |
||
360 | 360 | * |
361 | 361 | * @return array $messages New post updated messages |
362 | 362 | */ |
363 | -function give_updated_messages( $messages ) { |
|
363 | +function give_updated_messages($messages) { |
|
364 | 364 | global $post, $post_ID; |
365 | 365 | |
366 | - if ( ! give_is_setting_enabled( give_get_option( 'forms_singular' ) ) ) { |
|
366 | + if ( ! give_is_setting_enabled(give_get_option('forms_singular'))) { |
|
367 | 367 | |
368 | 368 | $messages['give_forms'] = array( |
369 | - 1 => __( 'Form updated.', 'give' ), |
|
370 | - 4 => __( 'Form updated.', 'give' ), |
|
371 | - 6 => __( 'Form published.', 'give' ), |
|
372 | - 7 => __( 'Form saved.', 'give' ), |
|
373 | - 8 => __( 'Form submitted.', 'give' ), |
|
369 | + 1 => __('Form updated.', 'give'), |
|
370 | + 4 => __('Form updated.', 'give'), |
|
371 | + 6 => __('Form published.', 'give'), |
|
372 | + 7 => __('Form saved.', 'give'), |
|
373 | + 8 => __('Form submitted.', 'give'), |
|
374 | 374 | ); |
375 | 375 | |
376 | 376 | } else { |
377 | 377 | |
378 | 378 | $messages['give_forms'] = array( |
379 | - 1 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form updated.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ), |
|
380 | - 4 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form updated.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ), |
|
381 | - 6 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form published.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ), |
|
382 | - 7 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form saved.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ), |
|
383 | - 8 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form submitted.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ), |
|
379 | + 1 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form updated.', 'give'), get_permalink($post_ID), __('View Form', 'give')), |
|
380 | + 4 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form updated.', 'give'), get_permalink($post_ID), __('View Form', 'give')), |
|
381 | + 6 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form published.', 'give'), get_permalink($post_ID), __('View Form', 'give')), |
|
382 | + 7 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form saved.', 'give'), get_permalink($post_ID), __('View Form', 'give')), |
|
383 | + 8 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form submitted.', 'give'), get_permalink($post_ID), __('View Form', 'give')), |
|
384 | 384 | ); |
385 | 385 | |
386 | 386 | } |
@@ -388,27 +388,27 @@ discard block |
||
388 | 388 | return $messages; |
389 | 389 | } |
390 | 390 | |
391 | -add_filter( 'post_updated_messages', 'give_updated_messages' ); |
|
391 | +add_filter('post_updated_messages', 'give_updated_messages'); |
|
392 | 392 | |
393 | 393 | |
394 | 394 | /** |
395 | 395 | * Setup Post Type Images |
396 | 396 | */ |
397 | -add_action( 'after_setup_theme', 'give_add_thumbnail_support', 10 ); |
|
397 | +add_action('after_setup_theme', 'give_add_thumbnail_support', 10); |
|
398 | 398 | |
399 | 399 | /** |
400 | 400 | * Ensure post thumbnail support is turned on |
401 | 401 | */ |
402 | 402 | function give_add_thumbnail_support() { |
403 | - if ( ! give_is_setting_enabled( give_get_option( 'form_featured_img' ) ) ) { |
|
403 | + if ( ! give_is_setting_enabled(give_get_option('form_featured_img'))) { |
|
404 | 404 | return; |
405 | 405 | } |
406 | 406 | |
407 | - if ( ! current_theme_supports( 'post-thumbnails' ) ) { |
|
408 | - add_theme_support( 'post-thumbnails' ); |
|
407 | + if ( ! current_theme_supports('post-thumbnails')) { |
|
408 | + add_theme_support('post-thumbnails'); |
|
409 | 409 | } |
410 | 410 | |
411 | - add_post_type_support( 'give_forms', 'thumbnail' ); |
|
411 | + add_post_type_support('give_forms', 'thumbnail'); |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | /** |
@@ -420,21 +420,21 @@ discard block |
||
420 | 420 | |
421 | 421 | // Single Give Forms (disabled if single turned off in settings) |
422 | 422 | if ( |
423 | - give_is_setting_enabled( give_get_option( 'forms_singular' ) ) |
|
424 | - && give_is_setting_enabled( give_get_option( 'form_sidebar' ) ) |
|
423 | + give_is_setting_enabled(give_get_option('forms_singular')) |
|
424 | + && give_is_setting_enabled(give_get_option('form_sidebar')) |
|
425 | 425 | ) { |
426 | 426 | |
427 | - register_sidebar( apply_filters( 'give_forms_single_sidebar', array( |
|
428 | - 'name' => __( 'Give Single Form Sidebar', 'give' ), |
|
427 | + register_sidebar(apply_filters('give_forms_single_sidebar', array( |
|
428 | + 'name' => __('Give Single Form Sidebar', 'give'), |
|
429 | 429 | 'id' => 'give-forms-sidebar', |
430 | - 'description' => __( 'Widgets in this area will be shown on the single Give forms aside area. This sidebar will not display for embedded forms.', 'give' ), |
|
430 | + 'description' => __('Widgets in this area will be shown on the single Give forms aside area. This sidebar will not display for embedded forms.', 'give'), |
|
431 | 431 | 'before_widget' => '<div id="%1$s" class="widget %2$s">', |
432 | 432 | 'after_widget' => '</div>', |
433 | 433 | 'before_title' => '<h3 class="widgettitle widget-title">', |
434 | 434 | 'after_title' => '</h3>', |
435 | - ) ) ); |
|
435 | + ))); |
|
436 | 436 | |
437 | 437 | } |
438 | 438 | } |
439 | 439 | |
440 | -add_action( 'widgets_init', 'give_widgets_init', 999 ); |
|
440 | +add_action('widgets_init', 'give_widgets_init', 999); |