@@ -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,40 +23,40 @@ discard block |
||
23 | 23 | function give_setup_post_types() { |
24 | 24 | |
25 | 25 | /** Give Forms Post Type */ |
26 | - $give_forms_singular = give_get_option( 'disable_forms_singular' ) !== 'on' ? true : false; |
|
26 | + $give_forms_singular = give_get_option('disable_forms_singular') !== 'on' ? true : false; |
|
27 | 27 | |
28 | - $give_forms_archives = give_get_option( 'disable_forms_archives' ) !== 'on' ? true : false; |
|
28 | + $give_forms_archives = give_get_option('disable_forms_archives') !== 'on' ? true : false; |
|
29 | 29 | |
30 | - $give_forms_slug = defined( 'GIVE_SLUG' ) ? GIVE_SLUG : 'donations'; |
|
30 | + $give_forms_slug = defined('GIVE_SLUG') ? GIVE_SLUG : 'donations'; |
|
31 | 31 | //support for old 'GIVE_FORMS_SLUG' constant |
32 | - if ( defined( 'GIVE_FORMS_SLUG' ) ) { |
|
32 | + if (defined('GIVE_FORMS_SLUG')) { |
|
33 | 33 | $give_forms_slug = GIVE_FORMS_SLUG; |
34 | 34 | } |
35 | 35 | |
36 | - $give_forms_rewrite = defined( 'GIVE_DISABLE_FORMS_REWRITE' ) && GIVE_DISABLE_FORMS_REWRITE ? false : array( |
|
36 | + $give_forms_rewrite = defined('GIVE_DISABLE_FORMS_REWRITE') && GIVE_DISABLE_FORMS_REWRITE ? false : array( |
|
37 | 37 | 'slug' => $give_forms_slug, |
38 | 38 | 'with_front' => false |
39 | 39 | ); |
40 | 40 | |
41 | - $give_forms_labels = apply_filters( 'give_forms_labels', array( |
|
42 | - 'name' => __( 'Donation %2$s', 'give' ), |
|
41 | + $give_forms_labels = apply_filters('give_forms_labels', array( |
|
42 | + 'name' => __('Donation %2$s', 'give'), |
|
43 | 43 | 'singular_name' => '%1$s', |
44 | - 'add_new' => __( 'Add %1$s', 'give' ), |
|
45 | - 'add_new_item' => __( 'Add New Donation %1$s', 'give' ), |
|
46 | - 'edit_item' => __( 'Edit Donation %1$s', 'give' ), |
|
47 | - 'new_item' => __( 'New %1$s', 'give' ), |
|
48 | - 'all_items' => __( 'All %2$s', 'give' ), |
|
49 | - 'view_item' => __( 'View %1$s', 'give' ), |
|
50 | - 'search_items' => __( 'Search %2$s', 'give' ), |
|
51 | - 'not_found' => __( 'No %2$s found', 'give' ), |
|
52 | - 'not_found_in_trash' => __( 'No %2$s found in Trash', 'give' ), |
|
44 | + 'add_new' => __('Add %1$s', 'give'), |
|
45 | + 'add_new_item' => __('Add New Donation %1$s', 'give'), |
|
46 | + 'edit_item' => __('Edit Donation %1$s', 'give'), |
|
47 | + 'new_item' => __('New %1$s', 'give'), |
|
48 | + 'all_items' => __('All %2$s', 'give'), |
|
49 | + 'view_item' => __('View %1$s', 'give'), |
|
50 | + 'search_items' => __('Search %2$s', 'give'), |
|
51 | + 'not_found' => __('No %2$s found', 'give'), |
|
52 | + 'not_found_in_trash' => __('No %2$s found in Trash', 'give'), |
|
53 | 53 | 'parent_item_colon' => '', |
54 | - 'menu_name' => apply_filters( 'give_menu_name', __( 'Donations', 'give' ) ), |
|
55 | - 'name_admin_bar' => apply_filters( 'give_name_admin_bar_name', __( 'Donation Form', 'give' ) ) |
|
56 | - ) ); |
|
54 | + 'menu_name' => apply_filters('give_menu_name', __('Donations', 'give')), |
|
55 | + 'name_admin_bar' => apply_filters('give_name_admin_bar_name', __('Donation Form', 'give')) |
|
56 | + )); |
|
57 | 57 | |
58 | - foreach ( $give_forms_labels as $key => $value ) { |
|
59 | - $give_forms_labels[ $key ] = sprintf( $value, give_get_forms_label_singular(), give_get_forms_label_plural() ); |
|
58 | + foreach ($give_forms_labels as $key => $value) { |
|
59 | + $give_forms_labels[$key] = sprintf($value, give_get_forms_label_singular(), give_get_forms_label_plural()); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | //Default give_forms supports |
@@ -69,14 +69,14 @@ discard block |
||
69 | 69 | ); |
70 | 70 | |
71 | 71 | //Has the user disabled the excerpt |
72 | - if ( give_get_option( 'disable_forms_excerpt' ) === 'on' ) { |
|
73 | - unset( $give_form_supports[2] ); |
|
72 | + if (give_get_option('disable_forms_excerpt') === 'on') { |
|
73 | + unset($give_form_supports[2]); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | //Has user disabled the featured image? |
77 | - if ( give_get_option( 'disable_form_featured_img' ) === 'on' ) { |
|
78 | - unset( $give_form_supports[1] ); |
|
79 | - remove_action( 'give_before_single_form_summary', 'give_show_form_images' ); |
|
77 | + if (give_get_option('disable_form_featured_img') === 'on') { |
|
78 | + unset($give_form_supports[1]); |
|
79 | + remove_action('give_before_single_form_summary', 'give_show_form_images'); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | $give_forms_args = array( |
@@ -92,42 +92,42 @@ discard block |
||
92 | 92 | 'has_archive' => $give_forms_archives, |
93 | 93 | 'menu_icon' => 'dashicons-give', |
94 | 94 | 'hierarchical' => false, |
95 | - 'supports' => apply_filters( 'give_forms_supports', $give_form_supports ), |
|
95 | + 'supports' => apply_filters('give_forms_supports', $give_form_supports), |
|
96 | 96 | ); |
97 | - register_post_type( 'give_forms', apply_filters( 'give_forms_post_type_args', $give_forms_args ) ); |
|
97 | + register_post_type('give_forms', apply_filters('give_forms_post_type_args', $give_forms_args)); |
|
98 | 98 | |
99 | 99 | /** Payment Post Type */ |
100 | 100 | $payment_labels = array( |
101 | - 'name' => _x( 'Donations', 'post type general name', 'give' ), |
|
102 | - 'singular_name' => _x( 'Donation', 'post type singular name', 'give' ), |
|
103 | - 'add_new' => __( 'Add New', 'give' ), |
|
104 | - 'add_new_item' => __( 'Add New Donation', 'give' ), |
|
105 | - 'edit_item' => __( 'Edit Donation', 'give' ), |
|
106 | - 'new_item' => __( 'New Donation', 'give' ), |
|
107 | - 'all_items' => __( 'All Donations', 'give' ), |
|
108 | - 'view_item' => __( 'View Donation', 'give' ), |
|
109 | - 'search_items' => __( 'Search Donations', 'give' ), |
|
110 | - 'not_found' => __( 'No Donations found', 'give' ), |
|
111 | - 'not_found_in_trash' => __( 'No Donations found in Trash', 'give' ), |
|
101 | + 'name' => _x('Donations', 'post type general name', 'give'), |
|
102 | + 'singular_name' => _x('Donation', 'post type singular name', 'give'), |
|
103 | + 'add_new' => __('Add New', 'give'), |
|
104 | + 'add_new_item' => __('Add New Donation', 'give'), |
|
105 | + 'edit_item' => __('Edit Donation', 'give'), |
|
106 | + 'new_item' => __('New Donation', 'give'), |
|
107 | + 'all_items' => __('All Donations', 'give'), |
|
108 | + 'view_item' => __('View Donation', 'give'), |
|
109 | + 'search_items' => __('Search Donations', 'give'), |
|
110 | + 'not_found' => __('No Donations found', 'give'), |
|
111 | + 'not_found_in_trash' => __('No Donations found in Trash', 'give'), |
|
112 | 112 | 'parent_item_colon' => '', |
113 | - 'menu_name' => __( 'Transactions', 'give' ) |
|
113 | + 'menu_name' => __('Transactions', 'give') |
|
114 | 114 | ); |
115 | 115 | |
116 | 116 | $payment_args = array( |
117 | - 'labels' => apply_filters( 'give_payment_labels', $payment_labels ), |
|
117 | + 'labels' => apply_filters('give_payment_labels', $payment_labels), |
|
118 | 118 | 'public' => false, |
119 | 119 | 'query_var' => false, |
120 | 120 | 'rewrite' => false, |
121 | 121 | 'map_meta_cap' => true, |
122 | 122 | 'capability_type' => 'give_payment', |
123 | - 'supports' => array( 'title' ), |
|
123 | + 'supports' => array('title'), |
|
124 | 124 | 'can_export' => true |
125 | 125 | ); |
126 | - register_post_type( 'give_payment', $payment_args ); |
|
126 | + register_post_type('give_payment', $payment_args); |
|
127 | 127 | |
128 | 128 | } |
129 | 129 | |
130 | -add_action( 'init', 'give_setup_post_types', 1 ); |
|
130 | +add_action('init', 'give_setup_post_types', 1); |
|
131 | 131 | |
132 | 132 | |
133 | 133 | /** |
@@ -140,30 +140,30 @@ discard block |
||
140 | 140 | */ |
141 | 141 | function give_setup_taxonomies() { |
142 | 142 | |
143 | - $slug = defined( 'GIVE_FORMS_SLUG' ) ? GIVE_FORMS_SLUG : 'donations'; |
|
143 | + $slug = defined('GIVE_FORMS_SLUG') ? GIVE_FORMS_SLUG : 'donations'; |
|
144 | 144 | |
145 | 145 | /** Categories */ |
146 | 146 | $category_labels = array( |
147 | - 'name' => sprintf( _x( '%s Categories', 'taxonomy general name', 'give' ), give_get_forms_label_singular() ), |
|
148 | - 'singular_name' => _x( 'Category', 'taxonomy singular name', 'give' ), |
|
149 | - 'search_items' => __( 'Search Categories', 'give' ), |
|
150 | - 'all_items' => __( 'All Categories', 'give' ), |
|
151 | - 'parent_item' => __( 'Parent Category', 'give' ), |
|
152 | - 'parent_item_colon' => __( 'Parent Category:', 'give' ), |
|
153 | - 'edit_item' => __( 'Edit Category', 'give' ), |
|
154 | - 'update_item' => __( 'Update Category', 'give' ), |
|
155 | - 'add_new_item' => sprintf( __( 'Add New %s Category', 'give' ), give_get_forms_label_singular() ), |
|
156 | - 'new_item_name' => __( 'New Category Name', 'give' ), |
|
157 | - 'menu_name' => __( 'Categories', 'give' ), |
|
147 | + 'name' => sprintf(_x('%s Categories', 'taxonomy general name', 'give'), give_get_forms_label_singular()), |
|
148 | + 'singular_name' => _x('Category', 'taxonomy singular name', 'give'), |
|
149 | + 'search_items' => __('Search Categories', 'give'), |
|
150 | + 'all_items' => __('All Categories', 'give'), |
|
151 | + 'parent_item' => __('Parent Category', 'give'), |
|
152 | + 'parent_item_colon' => __('Parent Category:', 'give'), |
|
153 | + 'edit_item' => __('Edit Category', 'give'), |
|
154 | + 'update_item' => __('Update Category', 'give'), |
|
155 | + 'add_new_item' => sprintf(__('Add New %s Category', 'give'), give_get_forms_label_singular()), |
|
156 | + 'new_item_name' => __('New Category Name', 'give'), |
|
157 | + 'menu_name' => __('Categories', 'give'), |
|
158 | 158 | ); |
159 | 159 | |
160 | - $category_args = apply_filters( 'give_forms_category_args', array( |
|
160 | + $category_args = apply_filters('give_forms_category_args', array( |
|
161 | 161 | 'hierarchical' => true, |
162 | - 'labels' => apply_filters( 'give_forms_category_labels', $category_labels ), |
|
162 | + 'labels' => apply_filters('give_forms_category_labels', $category_labels), |
|
163 | 163 | 'show_ui' => true, |
164 | 164 | 'query_var' => 'give_forms_category', |
165 | 165 | 'rewrite' => array( |
166 | - 'slug' => $slug . '/category', |
|
166 | + 'slug' => $slug.'/category', |
|
167 | 167 | 'with_front' => false, |
168 | 168 | 'hierarchical' => true |
169 | 169 | ), |
@@ -177,34 +177,34 @@ discard block |
||
177 | 177 | ); |
178 | 178 | |
179 | 179 | //Does the user want categories? |
180 | - if ( give_get_option( 'enable_categories' ) == 'on' ) { |
|
181 | - register_taxonomy( 'give_forms_category', array( 'give_forms' ), $category_args ); |
|
182 | - register_taxonomy_for_object_type( 'give_forms_category', 'give_forms' ); |
|
180 | + if (give_get_option('enable_categories') == 'on') { |
|
181 | + register_taxonomy('give_forms_category', array('give_forms'), $category_args); |
|
182 | + register_taxonomy_for_object_type('give_forms_category', 'give_forms'); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | |
186 | 186 | /** Tags */ |
187 | 187 | $tag_labels = array( |
188 | - 'name' => sprintf( _x( '%s Tags', 'taxonomy general name', 'give' ), give_get_forms_label_singular() ), |
|
189 | - 'singular_name' => _x( 'Tag', 'taxonomy singular name', 'give' ), |
|
190 | - 'search_items' => __( 'Search Tags', 'give' ), |
|
191 | - 'all_items' => __( 'All Tags', 'give' ), |
|
192 | - 'parent_item' => __( 'Parent Tag', 'give' ), |
|
193 | - 'parent_item_colon' => __( 'Parent Tag:', 'give' ), |
|
194 | - 'edit_item' => __( 'Edit Tag', 'give' ), |
|
195 | - 'update_item' => __( 'Update Tag', 'give' ), |
|
196 | - 'add_new_item' => __( 'Add New Tag', 'give' ), |
|
197 | - 'new_item_name' => __( 'New Tag Name', 'give' ), |
|
198 | - 'menu_name' => __( 'Tags', 'give' ), |
|
199 | - 'choose_from_most_used' => sprintf( __( 'Choose from most used %s tags', 'give' ), give_get_forms_label_singular() ), |
|
188 | + 'name' => sprintf(_x('%s Tags', 'taxonomy general name', 'give'), give_get_forms_label_singular()), |
|
189 | + 'singular_name' => _x('Tag', 'taxonomy singular name', 'give'), |
|
190 | + 'search_items' => __('Search Tags', 'give'), |
|
191 | + 'all_items' => __('All Tags', 'give'), |
|
192 | + 'parent_item' => __('Parent Tag', 'give'), |
|
193 | + 'parent_item_colon' => __('Parent Tag:', 'give'), |
|
194 | + 'edit_item' => __('Edit Tag', 'give'), |
|
195 | + 'update_item' => __('Update Tag', 'give'), |
|
196 | + 'add_new_item' => __('Add New Tag', 'give'), |
|
197 | + 'new_item_name' => __('New Tag Name', 'give'), |
|
198 | + 'menu_name' => __('Tags', 'give'), |
|
199 | + 'choose_from_most_used' => sprintf(__('Choose from most used %s tags', 'give'), give_get_forms_label_singular()), |
|
200 | 200 | ); |
201 | 201 | |
202 | - $tag_args = apply_filters( 'give_forms_tag_args', array( |
|
202 | + $tag_args = apply_filters('give_forms_tag_args', array( |
|
203 | 203 | 'hierarchical' => false, |
204 | - 'labels' => apply_filters( 'give_forms_tag_labels', $tag_labels ), |
|
204 | + 'labels' => apply_filters('give_forms_tag_labels', $tag_labels), |
|
205 | 205 | 'show_ui' => true, |
206 | 206 | 'query_var' => 'give_forms_tag', |
207 | - 'rewrite' => array( 'slug' => $slug . '/tag', 'with_front' => false, 'hierarchical' => true ), |
|
207 | + 'rewrite' => array('slug' => $slug.'/tag', 'with_front' => false, 'hierarchical' => true), |
|
208 | 208 | 'capabilities' => array( |
209 | 209 | 'manage_terms' => 'manage_give_forms_terms', |
210 | 210 | 'edit_terms' => 'edit_give_forms_terms', |
@@ -215,15 +215,15 @@ discard block |
||
215 | 215 | ) |
216 | 216 | ); |
217 | 217 | |
218 | - if ( give_get_option( 'enable_tags' ) == 'on' ) { |
|
219 | - register_taxonomy( 'give_forms_tag', array( 'give_forms' ), $tag_args ); |
|
220 | - register_taxonomy_for_object_type( 'give_forms_tag', 'give_forms' ); |
|
218 | + if (give_get_option('enable_tags') == 'on') { |
|
219 | + register_taxonomy('give_forms_tag', array('give_forms'), $tag_args); |
|
220 | + register_taxonomy_for_object_type('give_forms_tag', 'give_forms'); |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | |
224 | 224 | } |
225 | 225 | |
226 | -add_action( 'init', 'give_setup_taxonomies', 0 ); |
|
226 | +add_action('init', 'give_setup_taxonomies', 0); |
|
227 | 227 | |
228 | 228 | |
229 | 229 | /** |
@@ -234,11 +234,11 @@ discard block |
||
234 | 234 | */ |
235 | 235 | function give_get_default_form_labels() { |
236 | 236 | $defaults = array( |
237 | - 'singular' => __( 'Form', 'give' ), |
|
238 | - 'plural' => __( 'Forms', 'give' ) |
|
237 | + 'singular' => __('Form', 'give'), |
|
238 | + 'plural' => __('Forms', 'give') |
|
239 | 239 | ); |
240 | 240 | |
241 | - return apply_filters( 'give_default_form_name', $defaults ); |
|
241 | + return apply_filters('give_default_form_name', $defaults); |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | /** |
@@ -249,11 +249,11 @@ discard block |
||
249 | 249 | */ |
250 | 250 | function give_get_default_campaign_labels() { |
251 | 251 | $defaults = array( |
252 | - 'singular' => __( 'Campaign', 'give' ), |
|
253 | - 'plural' => __( 'Campaigns', 'give' ) |
|
252 | + 'singular' => __('Campaign', 'give'), |
|
253 | + 'plural' => __('Campaigns', 'give') |
|
254 | 254 | ); |
255 | 255 | |
256 | - return apply_filters( 'give_default_campaign_name', $defaults ); |
|
256 | + return apply_filters('give_default_campaign_name', $defaults); |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | /** |
@@ -265,10 +265,10 @@ discard block |
||
265 | 265 | * |
266 | 266 | * @return string $defaults['singular'] Singular label |
267 | 267 | */ |
268 | -function give_get_forms_label_singular( $lowercase = false ) { |
|
268 | +function give_get_forms_label_singular($lowercase = false) { |
|
269 | 269 | $defaults = give_get_default_form_labels(); |
270 | 270 | |
271 | - return ( $lowercase ) ? strtolower( $defaults['singular'] ) : $defaults['singular']; |
|
271 | + return ($lowercase) ? strtolower($defaults['singular']) : $defaults['singular']; |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | /** |
@@ -277,10 +277,10 @@ discard block |
||
277 | 277 | * @since 1.0 |
278 | 278 | * @return string $defaults['plural'] Plural label |
279 | 279 | */ |
280 | -function give_get_forms_label_plural( $lowercase = false ) { |
|
280 | +function give_get_forms_label_plural($lowercase = false) { |
|
281 | 281 | $defaults = give_get_default_form_labels(); |
282 | 282 | |
283 | - return ( $lowercase ) ? strtolower( $defaults['plural'] ) : $defaults['plural']; |
|
283 | + return ($lowercase) ? strtolower($defaults['plural']) : $defaults['plural']; |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | /** |
@@ -292,10 +292,10 @@ discard block |
||
292 | 292 | * |
293 | 293 | * @return string $defaults['singular'] Singular label |
294 | 294 | */ |
295 | -function give_get_campaigns_label_singular( $lowercase = false ) { |
|
295 | +function give_get_campaigns_label_singular($lowercase = false) { |
|
296 | 296 | $defaults = give_get_default_campaign_labels(); |
297 | 297 | |
298 | - return ( $lowercase ) ? strtolower( $defaults['singular'] ) : $defaults['singular']; |
|
298 | + return ($lowercase) ? strtolower($defaults['singular']) : $defaults['singular']; |
|
299 | 299 | } |
300 | 300 | |
301 | 301 | /** |
@@ -304,10 +304,10 @@ discard block |
||
304 | 304 | * @since 1.0 |
305 | 305 | * @return string $defaults['plural'] Plural label |
306 | 306 | */ |
307 | -function give_get_campaigns_label_plural( $lowercase = false ) { |
|
307 | +function give_get_campaigns_label_plural($lowercase = false) { |
|
308 | 308 | $defaults = give_get_default_campaign_labels(); |
309 | 309 | |
310 | - return ( $lowercase ) ? strtolower( $defaults['plural'] ) : $defaults['plural']; |
|
310 | + return ($lowercase) ? strtolower($defaults['plural']) : $defaults['plural']; |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | /** |
@@ -319,26 +319,26 @@ discard block |
||
319 | 319 | * |
320 | 320 | * @return string $title New placeholder text |
321 | 321 | */ |
322 | -function give_change_default_title( $title ) { |
|
322 | +function give_change_default_title($title) { |
|
323 | 323 | // If a frontend plugin uses this filter (check extensions before changing this function) |
324 | - if ( ! is_admin() ) { |
|
324 | + if ( ! is_admin()) { |
|
325 | 325 | $label = give_get_forms_label_singular(); |
326 | - $title = sprintf( __( 'Enter %s title here', 'give' ), $label ); |
|
326 | + $title = sprintf(__('Enter %s title here', 'give'), $label); |
|
327 | 327 | |
328 | 328 | return $title; |
329 | 329 | } |
330 | 330 | |
331 | 331 | $screen = get_current_screen(); |
332 | 332 | |
333 | - if ( 'give_forms' == $screen->post_type ) { |
|
333 | + if ('give_forms' == $screen->post_type) { |
|
334 | 334 | $label = give_get_forms_label_singular(); |
335 | - $title = sprintf( __( 'Enter %s title here', 'give' ), $label ); |
|
335 | + $title = sprintf(__('Enter %s title here', 'give'), $label); |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | return $title; |
339 | 339 | } |
340 | 340 | |
341 | -add_filter( 'enter_title_here', 'give_change_default_title' ); |
|
341 | +add_filter('enter_title_here', 'give_change_default_title'); |
|
342 | 342 | |
343 | 343 | /** |
344 | 344 | * Registers Custom Post Statuses which are used by the Payments |
@@ -348,50 +348,50 @@ discard block |
||
348 | 348 | */ |
349 | 349 | function give_register_post_type_statuses() { |
350 | 350 | // Payment Statuses |
351 | - register_post_status( 'refunded', array( |
|
352 | - 'label' => _x( 'Refunded', 'Refunded payment status', 'give' ), |
|
351 | + register_post_status('refunded', array( |
|
352 | + 'label' => _x('Refunded', 'Refunded payment status', 'give'), |
|
353 | 353 | 'public' => true, |
354 | 354 | 'exclude_from_search' => false, |
355 | 355 | 'show_in_admin_all_list' => true, |
356 | 356 | 'show_in_admin_status_list' => true, |
357 | - 'label_count' => _n_noop( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'give' ) |
|
358 | - ) ); |
|
359 | - register_post_status( 'failed', array( |
|
360 | - 'label' => _x( 'Failed', 'Failed payment status', 'give' ), |
|
357 | + 'label_count' => _n_noop('Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'give') |
|
358 | + )); |
|
359 | + register_post_status('failed', array( |
|
360 | + 'label' => _x('Failed', 'Failed payment status', 'give'), |
|
361 | 361 | 'public' => true, |
362 | 362 | 'exclude_from_search' => false, |
363 | 363 | 'show_in_admin_all_list' => true, |
364 | 364 | 'show_in_admin_status_list' => true, |
365 | - 'label_count' => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'give' ) |
|
366 | - ) ); |
|
367 | - register_post_status( 'revoked', array( |
|
368 | - 'label' => _x( 'Revoked', 'Revoked payment status', 'give' ), |
|
365 | + 'label_count' => _n_noop('Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'give') |
|
366 | + )); |
|
367 | + register_post_status('revoked', array( |
|
368 | + 'label' => _x('Revoked', 'Revoked payment status', 'give'), |
|
369 | 369 | 'public' => true, |
370 | 370 | 'exclude_from_search' => false, |
371 | 371 | 'show_in_admin_all_list' => true, |
372 | 372 | 'show_in_admin_status_list' => true, |
373 | - 'label_count' => _n_noop( 'Revoked <span class="count">(%s)</span>', 'Revoked <span class="count">(%s)</span>', 'give' ) |
|
374 | - ) ); |
|
375 | - register_post_status( 'cancelled', array( |
|
376 | - 'label' => _x( 'Cancelled', 'Cancelled payment status', 'give' ), |
|
373 | + 'label_count' => _n_noop('Revoked <span class="count">(%s)</span>', 'Revoked <span class="count">(%s)</span>', 'give') |
|
374 | + )); |
|
375 | + register_post_status('cancelled', array( |
|
376 | + 'label' => _x('Cancelled', 'Cancelled payment status', 'give'), |
|
377 | 377 | 'public' => true, |
378 | 378 | 'exclude_from_search' => false, |
379 | 379 | 'show_in_admin_all_list' => true, |
380 | 380 | 'show_in_admin_status_list' => true, |
381 | - 'label_count' => _n_noop( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'give' ) |
|
382 | - ) ); |
|
383 | - register_post_status( 'abandoned', array( |
|
384 | - 'label' => _x( 'Abandoned', 'Abandoned payment status', 'give' ), |
|
381 | + 'label_count' => _n_noop('Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'give') |
|
382 | + )); |
|
383 | + register_post_status('abandoned', array( |
|
384 | + 'label' => _x('Abandoned', 'Abandoned payment status', 'give'), |
|
385 | 385 | 'public' => true, |
386 | 386 | 'exclude_from_search' => false, |
387 | 387 | 'show_in_admin_all_list' => true, |
388 | 388 | 'show_in_admin_status_list' => true, |
389 | - 'label_count' => _n_noop( 'Abandoned <span class="count">(%s)</span>', 'Abandoned <span class="count">(%s)</span>', 'give' ) |
|
390 | - ) ); |
|
389 | + 'label_count' => _n_noop('Abandoned <span class="count">(%s)</span>', 'Abandoned <span class="count">(%s)</span>', 'give') |
|
390 | + )); |
|
391 | 391 | |
392 | 392 | } |
393 | 393 | |
394 | -add_action( 'init', 'give_register_post_type_statuses' ); |
|
394 | +add_action('init', 'give_register_post_type_statuses'); |
|
395 | 395 | |
396 | 396 | /** |
397 | 397 | * Updated Messages |
@@ -404,44 +404,44 @@ discard block |
||
404 | 404 | * |
405 | 405 | * @return array $messages New post updated messages |
406 | 406 | */ |
407 | -function give_updated_messages( $messages ) { |
|
407 | +function give_updated_messages($messages) { |
|
408 | 408 | global $post, $post_ID; |
409 | 409 | |
410 | - $url1 = '<a href="' . get_permalink( $post_ID ) . '">'; |
|
410 | + $url1 = '<a href="'.get_permalink($post_ID).'">'; |
|
411 | 411 | $url2 = give_get_forms_label_singular(); |
412 | 412 | $url3 = '</a>'; |
413 | 413 | |
414 | 414 | $messages['give_forms'] = array( |
415 | - 1 => sprintf( __( '%2$s updated. %1$sView %2$s%3$s.', 'give' ), $url1, $url2, $url3 ), |
|
416 | - 4 => sprintf( __( '%2$s updated. %1$sView %2$s%3$s.', 'give' ), $url1, $url2, $url3 ), |
|
417 | - 6 => sprintf( __( '%2$s published. %1$sView %2$s%3$s.', 'give' ), $url1, $url2, $url3 ), |
|
418 | - 7 => sprintf( __( '%2$s saved. %1$sView %2$s%3$s.', 'give' ), $url1, $url2, $url3 ), |
|
419 | - 8 => sprintf( __( '%2$s submitted. %1$sView %2$s%3$s.', 'give' ), $url1, $url2, $url3 ) |
|
415 | + 1 => sprintf(__('%2$s updated. %1$sView %2$s%3$s.', 'give'), $url1, $url2, $url3), |
|
416 | + 4 => sprintf(__('%2$s updated. %1$sView %2$s%3$s.', 'give'), $url1, $url2, $url3), |
|
417 | + 6 => sprintf(__('%2$s published. %1$sView %2$s%3$s.', 'give'), $url1, $url2, $url3), |
|
418 | + 7 => sprintf(__('%2$s saved. %1$sView %2$s%3$s.', 'give'), $url1, $url2, $url3), |
|
419 | + 8 => sprintf(__('%2$s submitted. %1$sView %2$s%3$s.', 'give'), $url1, $url2, $url3) |
|
420 | 420 | ); |
421 | 421 | |
422 | 422 | return $messages; |
423 | 423 | } |
424 | 424 | |
425 | -add_filter( 'post_updated_messages', 'give_updated_messages' ); |
|
425 | +add_filter('post_updated_messages', 'give_updated_messages'); |
|
426 | 426 | |
427 | 427 | |
428 | 428 | /** |
429 | 429 | * Setup Post Type Images |
430 | 430 | */ |
431 | -add_action( 'after_setup_theme', 'give_add_thumbnail_support', 10 ); |
|
431 | +add_action('after_setup_theme', 'give_add_thumbnail_support', 10); |
|
432 | 432 | |
433 | 433 | /** |
434 | 434 | * Ensure post thumbnail support is turned on |
435 | 435 | */ |
436 | 436 | function give_add_thumbnail_support() { |
437 | - if ( give_get_option( 'disable_form_featured_img' ) === 'on' ) { |
|
437 | + if (give_get_option('disable_form_featured_img') === 'on') { |
|
438 | 438 | return; |
439 | 439 | } |
440 | - if ( ! current_theme_supports( 'post-thumbnails' ) ) { |
|
441 | - add_theme_support( 'post-thumbnails' ); |
|
440 | + if ( ! current_theme_supports('post-thumbnails')) { |
|
441 | + add_theme_support('post-thumbnails'); |
|
442 | 442 | } |
443 | - add_post_type_support( 'give_forms', 'thumbnail' ); |
|
444 | - add_post_type_support( 'give_campaigns', 'thumbnail' ); |
|
443 | + add_post_type_support('give_forms', 'thumbnail'); |
|
444 | + add_post_type_support('give_campaigns', 'thumbnail'); |
|
445 | 445 | } |
446 | 446 | |
447 | 447 | /** |
@@ -453,19 +453,19 @@ discard block |
||
453 | 453 | function give_widgets_init() { |
454 | 454 | |
455 | 455 | //Single Give Forms (disabled if single turned off in settings) |
456 | - if ( give_get_option( 'disable_forms_singular' ) !== 'on' && give_get_option( 'disable_form_sidebar' ) !== 'on' ) { |
|
456 | + if (give_get_option('disable_forms_singular') !== 'on' && give_get_option('disable_form_sidebar') !== 'on') { |
|
457 | 457 | |
458 | - register_sidebar( apply_filters( 'give_forms_single_sidebar', array( |
|
459 | - 'name' => __( 'Give Single Form Sidebar', 'give' ), |
|
458 | + register_sidebar(apply_filters('give_forms_single_sidebar', array( |
|
459 | + 'name' => __('Give Single Form Sidebar', 'give'), |
|
460 | 460 | 'id' => 'give-forms-sidebar', |
461 | - 'description' => __( 'Widgets in this area will be shown on the single Give forms aside area. This sidebar will not display for embedded forms.', 'give' ), |
|
461 | + 'description' => __('Widgets in this area will be shown on the single Give forms aside area. This sidebar will not display for embedded forms.', 'give'), |
|
462 | 462 | 'before_widget' => '<div id="%1$s" class="widget %2$s">', |
463 | 463 | 'after_widget' => '</div>', |
464 | 464 | 'before_title' => '<h3 class="widgettitle widget-title">', |
465 | 465 | 'after_title' => '</h3>', |
466 | - ) ) ); |
|
466 | + ))); |
|
467 | 467 | |
468 | 468 | } |
469 | 469 | } |
470 | 470 | |
471 | -add_action( 'widgets_init', 'give_widgets_init', 999 ); |
|
471 | +add_action('widgets_init', 'give_widgets_init', 999); |