|
@@ -10,7 +10,7 @@ discard block |
|
|
block discarded – undo |
|
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
|
|
|
@@ -25,25 +25,25 @@ discard block |
|
|
block discarded – undo |
|
25
|
25
|
*/ |
|
26
|
26
|
function give_load_scripts() { |
|
27
|
27
|
|
|
28
|
|
- $js_dir = GIVE_PLUGIN_URL . 'assets/js/frontend/'; |
|
29
|
|
- $js_plugins = GIVE_PLUGIN_URL . 'assets/js/plugins/'; |
|
30
|
|
- $scripts_footer = ( give_is_setting_enabled( give_get_option( 'scripts_footer' ) ) ) ? true : false; |
|
|
28
|
+ $js_dir = GIVE_PLUGIN_URL.'assets/js/frontend/'; |
|
|
29
|
+ $js_plugins = GIVE_PLUGIN_URL.'assets/js/plugins/'; |
|
|
30
|
+ $scripts_footer = (give_is_setting_enabled(give_get_option('scripts_footer'))) ? true : false; |
|
31
|
31
|
|
|
32
|
32
|
// Use minified libraries if SCRIPT_DEBUG is turned off. |
|
33
|
|
- $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
|
|
33
|
+ $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
34
|
34
|
|
|
35
|
35
|
// Localize / PHP to AJAX vars. |
|
36
|
|
- $localize_give_vars = apply_filters( 'give_global_script_vars', array( |
|
|
36
|
+ $localize_give_vars = apply_filters('give_global_script_vars', array( |
|
37
|
37
|
'ajaxurl' => give_get_ajax_url(), |
|
38
|
|
- 'checkout_nonce' => wp_create_nonce( 'give_checkout_nonce' ), |
|
39
|
|
- 'currency_sign' => give_currency_filter( '' ), |
|
|
38
|
+ 'checkout_nonce' => wp_create_nonce('give_checkout_nonce'), |
|
|
39
|
+ 'currency_sign' => give_currency_filter(''), |
|
40
|
40
|
'currency_pos' => give_get_currency_position(), |
|
41
|
41
|
'thousands_separator' => give_get_price_thousand_separator(), |
|
42
|
42
|
'decimal_separator' => give_get_price_decimal_separator(), |
|
43
|
|
- 'no_gateway' => __( 'Please select a payment method.', 'give' ), |
|
44
|
|
- 'bad_minimum' => __( 'The minimum donation amount for this form is', 'give' ), |
|
45
|
|
- 'general_loading' => __( 'Loading...', 'give' ), |
|
46
|
|
- 'purchase_loading' => __( 'Please Wait...', 'give' ), |
|
|
43
|
+ 'no_gateway' => __('Please select a payment method.', 'give'), |
|
|
44
|
+ 'bad_minimum' => __('The minimum donation amount for this form is', 'give'), |
|
|
45
|
+ 'general_loading' => __('Loading...', 'give'), |
|
|
46
|
+ 'purchase_loading' => __('Please Wait...', 'give'), |
|
47
|
47
|
'number_decimals' => give_get_price_decimals(), |
|
48
|
48
|
'give_version' => GIVE_VERSION, |
|
49
|
49
|
'magnific_options' => apply_filters( |
|
@@ -57,81 +57,81 @@ discard block |
|
|
block discarded – undo |
|
57
|
57
|
'give_form_translation_js', |
|
58
|
58
|
array( |
|
59
|
59
|
// Field name Validation message. |
|
60
|
|
- 'payment-mode' => __( 'Please select payment mode.', 'give' ), |
|
61
|
|
- 'give_first' => __( 'Please enter your first name.', 'give' ), |
|
62
|
|
- 'give_email' => __( 'Please enter a valid email address.', 'give' ), |
|
63
|
|
- 'give_user_login' => __( 'Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give' ), |
|
64
|
|
- 'give_user_pass' => __( 'Enter a password.', 'give' ), |
|
65
|
|
- 'give_user_pass_confirm' => __( 'Enter the password confirmation.', 'give' ), |
|
66
|
|
- 'give_agree_to_terms' => __( 'You must agree to the terms and conditions.', 'give' ), |
|
|
60
|
+ 'payment-mode' => __('Please select payment mode.', 'give'), |
|
|
61
|
+ 'give_first' => __('Please enter your first name.', 'give'), |
|
|
62
|
+ 'give_email' => __('Please enter a valid email address.', 'give'), |
|
|
63
|
+ 'give_user_login' => __('Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give'), |
|
|
64
|
+ 'give_user_pass' => __('Enter a password.', 'give'), |
|
|
65
|
+ 'give_user_pass_confirm' => __('Enter the password confirmation.', 'give'), |
|
|
66
|
+ 'give_agree_to_terms' => __('You must agree to the terms and conditions.', 'give'), |
|
67
|
67
|
) |
|
68
|
68
|
), |
|
69
|
|
- ) ); |
|
|
69
|
+ )); |
|
70
|
70
|
|
|
71
|
|
- $localize_give_ajax = apply_filters( 'give_global_ajax_vars', array( |
|
|
71
|
+ $localize_give_ajax = apply_filters('give_global_ajax_vars', array( |
|
72
|
72
|
'ajaxurl' => give_get_ajax_url(), |
|
73
|
|
- 'loading' => __( 'Loading', 'give' ), |
|
|
73
|
+ 'loading' => __('Loading', 'give'), |
|
74
|
74
|
// General loading message. |
|
75
|
|
- 'select_option' => __( 'Please select an option', 'give' ), |
|
|
75
|
+ 'select_option' => __('Please select an option', 'give'), |
|
76
|
76
|
// Variable pricing error with multi-donation option enabled. |
|
77
|
|
- 'default_gateway' => give_get_default_gateway( null ), |
|
78
|
|
- 'permalinks' => get_option( 'permalink_structure' ) ? '1' : '0', |
|
|
77
|
+ 'default_gateway' => give_get_default_gateway(null), |
|
|
78
|
+ 'permalinks' => get_option('permalink_structure') ? '1' : '0', |
|
79
|
79
|
'number_decimals' => give_get_price_decimals(), |
|
80
|
|
- ) ); |
|
|
80
|
+ )); |
|
81
|
81
|
|
|
82
|
82
|
// DEBUG is On. |
|
83
|
|
- if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { |
|
|
83
|
+ if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) { |
|
84
|
84
|
|
|
85
|
|
- if ( give_is_cc_verify_enabled() ) { |
|
86
|
|
- wp_register_script( 'give-cc-validator', $js_plugins . 'jquery.payment' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
87
|
|
- wp_enqueue_script( 'give-cc-validator' ); |
|
|
85
|
+ if (give_is_cc_verify_enabled()) { |
|
|
86
|
+ wp_register_script('give-cc-validator', $js_plugins.'jquery.payment'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
|
87
|
+ wp_enqueue_script('give-cc-validator'); |
|
88
|
88
|
} |
|
89
|
89
|
|
|
90
|
|
- wp_register_script( 'give-float-labels', $js_plugins . 'float-labels' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
91
|
|
- wp_enqueue_script( 'give-float-labels' ); |
|
|
90
|
+ wp_register_script('give-float-labels', $js_plugins.'float-labels'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
|
91
|
+ wp_enqueue_script('give-float-labels'); |
|
92
|
92
|
|
|
93
|
|
- wp_register_script( 'give-blockui', $js_plugins . 'jquery.blockUI' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
94
|
|
- wp_enqueue_script( 'give-blockui' ); |
|
|
93
|
+ wp_register_script('give-blockui', $js_plugins.'jquery.blockUI'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
|
94
|
+ wp_enqueue_script('give-blockui'); |
|
95
|
95
|
|
|
96
|
|
- wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
97
|
|
- wp_enqueue_script( 'give-qtip' ); |
|
|
96
|
+ wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
|
97
|
+ wp_enqueue_script('give-qtip'); |
|
98
|
98
|
|
|
99
|
|
- wp_register_script( 'give-accounting', $js_plugins . 'accounting' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
100
|
|
- wp_enqueue_script( 'give-accounting' ); |
|
|
99
|
+ wp_register_script('give-accounting', $js_plugins.'accounting'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
|
100
|
+ wp_enqueue_script('give-accounting'); |
|
101
|
101
|
|
|
102
|
|
- wp_register_script( 'give-magnific', $js_plugins . 'jquery.magnific-popup' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
103
|
|
- wp_enqueue_script( 'give-magnific' ); |
|
|
102
|
+ wp_register_script('give-magnific', $js_plugins.'jquery.magnific-popup'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
|
103
|
+ wp_enqueue_script('give-magnific'); |
|
104
|
104
|
|
|
105
|
|
- wp_register_script( 'give-checkout-global', $js_dir . 'give-checkout-global' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
106
|
|
- wp_enqueue_script( 'give-checkout-global' ); |
|
|
105
|
+ wp_register_script('give-checkout-global', $js_dir.'give-checkout-global'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
|
106
|
+ wp_enqueue_script('give-checkout-global'); |
|
107
|
107
|
|
|
108
|
108
|
// General scripts. |
|
109
|
|
- wp_register_script( 'give-scripts', $js_dir . 'give' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
110
|
|
- wp_enqueue_script( 'give-scripts' ); |
|
|
109
|
+ wp_register_script('give-scripts', $js_dir.'give'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
|
110
|
+ wp_enqueue_script('give-scripts'); |
|
111
|
111
|
|
|
112
|
112
|
// Load AJAX scripts, if enabled. |
|
113
|
|
- wp_register_script( 'give-ajax', $js_dir . 'give-ajax' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
114
|
|
- wp_enqueue_script( 'give-ajax' ); |
|
|
113
|
+ wp_register_script('give-ajax', $js_dir.'give-ajax'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
|
114
|
+ wp_enqueue_script('give-ajax'); |
|
115
|
115
|
|
|
116
|
116
|
// Localize / Pass AJAX vars from PHP, |
|
117
|
|
- wp_localize_script( 'give-checkout-global', 'give_global_vars', $localize_give_vars ); |
|
118
|
|
- wp_localize_script( 'give-ajax', 'give_scripts', $localize_give_ajax ); |
|
|
117
|
+ wp_localize_script('give-checkout-global', 'give_global_vars', $localize_give_vars); |
|
|
118
|
+ wp_localize_script('give-ajax', 'give_scripts', $localize_give_ajax); |
|
119
|
119
|
|
|
120
|
120
|
} else { |
|
121
|
121
|
|
|
122
|
122
|
// DEBUG is OFF (one JS file to rule them all!). |
|
123
|
|
- wp_register_script( 'give', $js_dir . 'give.all.min.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
124
|
|
- wp_enqueue_script( 'give' ); |
|
|
123
|
+ wp_register_script('give', $js_dir.'give.all.min.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
|
124
|
+ wp_enqueue_script('give'); |
|
125
|
125
|
|
|
126
|
126
|
// Localize / Pass AJAX vars from PHP. |
|
127
|
|
- wp_localize_script( 'give', 'give_global_vars', $localize_give_vars ); |
|
128
|
|
- wp_localize_script( 'give', 'give_scripts', $localize_give_ajax ); |
|
|
127
|
+ wp_localize_script('give', 'give_global_vars', $localize_give_vars); |
|
|
128
|
+ wp_localize_script('give', 'give_scripts', $localize_give_ajax); |
|
129
|
129
|
|
|
130
|
130
|
} |
|
131
|
131
|
|
|
132
|
132
|
} |
|
133
|
133
|
|
|
134
|
|
-add_action( 'wp_enqueue_scripts', 'give_load_scripts' ); |
|
|
134
|
+add_action('wp_enqueue_scripts', 'give_load_scripts'); |
|
135
|
135
|
|
|
136
|
136
|
/** |
|
137
|
137
|
* Register styles. |
|
@@ -144,16 +144,16 @@ discard block |
|
|
block discarded – undo |
|
144
|
144
|
*/ |
|
145
|
145
|
function give_register_styles() { |
|
146
|
146
|
|
|
147
|
|
- if ( ! give_is_setting_enabled( give_get_option( 'css' ) ) ) { |
|
|
147
|
+ if ( ! give_is_setting_enabled(give_get_option('css'))) { |
|
148
|
148
|
return; |
|
149
|
149
|
} |
|
150
|
150
|
|
|
151
|
|
- wp_register_style( 'give-styles', give_get_stylesheet_uri(), array(), GIVE_VERSION, 'all' ); |
|
152
|
|
- wp_enqueue_style( 'give-styles' ); |
|
|
151
|
+ wp_register_style('give-styles', give_get_stylesheet_uri(), array(), GIVE_VERSION, 'all'); |
|
|
152
|
+ wp_enqueue_style('give-styles'); |
|
153
|
153
|
|
|
154
|
154
|
} |
|
155
|
155
|
|
|
156
|
|
-add_action( 'wp_enqueue_scripts', 'give_register_styles' ); |
|
|
156
|
+add_action('wp_enqueue_scripts', 'give_register_styles'); |
|
157
|
157
|
|
|
158
|
158
|
|
|
159
|
159
|
/** |
|
@@ -166,19 +166,19 @@ discard block |
|
|
block discarded – undo |
|
166
|
166
|
function give_get_stylesheet_uri() { |
|
167
|
167
|
|
|
168
|
168
|
// Use minified libraries if SCRIPT_DEBUG is turned off. |
|
169
|
|
- $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
|
|
169
|
+ $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
170
|
170
|
|
|
171
|
171
|
// LTR or RTL files. |
|
172
|
|
- $direction = ( is_rtl() ) ? '-rtl' : ''; |
|
|
172
|
+ $direction = (is_rtl()) ? '-rtl' : ''; |
|
173
|
173
|
|
|
174
|
|
- $file = 'give' . $direction . $suffix . '.css'; |
|
|
174
|
+ $file = 'give'.$direction.$suffix.'.css'; |
|
175
|
175
|
$templates_dir = give_get_theme_template_dir_name(); |
|
176
|
176
|
|
|
177
|
|
- $child_theme_style_sheet = trailingslashit( get_stylesheet_directory() ) . $templates_dir . $file; |
|
178
|
|
- $child_theme_style_sheet_2 = trailingslashit( get_stylesheet_directory() ) . $templates_dir . 'give' . $direction . '.css'; |
|
179
|
|
- $parent_theme_style_sheet = trailingslashit( get_template_directory() ) . $templates_dir . $file; |
|
180
|
|
- $parent_theme_style_sheet_2 = trailingslashit( get_template_directory() ) . $templates_dir . 'give' . $direction . '.css'; |
|
181
|
|
- $give_plugin_style_sheet = trailingslashit( give_get_templates_dir() ) . $file; |
|
|
177
|
+ $child_theme_style_sheet = trailingslashit(get_stylesheet_directory()).$templates_dir.$file; |
|
|
178
|
+ $child_theme_style_sheet_2 = trailingslashit(get_stylesheet_directory()).$templates_dir.'give'.$direction.'.css'; |
|
|
179
|
+ $parent_theme_style_sheet = trailingslashit(get_template_directory()).$templates_dir.$file; |
|
|
180
|
+ $parent_theme_style_sheet_2 = trailingslashit(get_template_directory()).$templates_dir.'give'.$direction.'.css'; |
|
|
181
|
+ $give_plugin_style_sheet = trailingslashit(give_get_templates_dir()).$file; |
|
182
|
182
|
|
|
183
|
183
|
$uri = false; |
|
184
|
184
|
|
|
@@ -188,23 +188,23 @@ discard block |
|
|
block discarded – undo |
|
188
|
188
|
* followed by non minified version, even if SCRIPT_DEBUG is not enabled. |
|
189
|
189
|
* This allows users to copy just give.css to their theme. |
|
190
|
190
|
*/ |
|
191
|
|
- if ( file_exists( $child_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $child_theme_style_sheet_2 ) ) ) ) { |
|
192
|
|
- if ( ! empty( $nonmin ) ) { |
|
193
|
|
- $uri = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . 'give' . $direction . '.css'; |
|
|
191
|
+ if (file_exists($child_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($child_theme_style_sheet_2)))) { |
|
|
192
|
+ if ( ! empty($nonmin)) { |
|
|
193
|
+ $uri = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.'give'.$direction.'.css'; |
|
194
|
194
|
} else { |
|
195
|
|
- $uri = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . $file; |
|
|
195
|
+ $uri = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.$file; |
|
196
|
196
|
} |
|
197
|
|
- } elseif ( file_exists( $parent_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $parent_theme_style_sheet_2 ) ) ) ) { |
|
198
|
|
- if ( ! empty( $nonmin ) ) { |
|
199
|
|
- $uri = trailingslashit( get_template_directory_uri() ) . $templates_dir . 'give' . $direction . '.css'; |
|
|
197
|
+ } elseif (file_exists($parent_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($parent_theme_style_sheet_2)))) { |
|
|
198
|
+ if ( ! empty($nonmin)) { |
|
|
199
|
+ $uri = trailingslashit(get_template_directory_uri()).$templates_dir.'give'.$direction.'.css'; |
|
200
|
200
|
} else { |
|
201
|
|
- $uri = trailingslashit( get_template_directory_uri() ) . $templates_dir . $file; |
|
|
201
|
+ $uri = trailingslashit(get_template_directory_uri()).$templates_dir.$file; |
|
202
|
202
|
} |
|
203
|
|
- } elseif ( file_exists( $give_plugin_style_sheet ) || file_exists( $give_plugin_style_sheet ) ) { |
|
204
|
|
- $uri = trailingslashit( give_get_templates_url() ) . $file; |
|
|
203
|
+ } elseif (file_exists($give_plugin_style_sheet) || file_exists($give_plugin_style_sheet)) { |
|
|
204
|
+ $uri = trailingslashit(give_get_templates_url()).$file; |
|
205
|
205
|
} |
|
206
|
206
|
|
|
207
|
|
- return apply_filters( 'give_get_stylesheet_uri', $uri ); |
|
|
207
|
+ return apply_filters('give_get_stylesheet_uri', $uri); |
|
208
|
208
|
|
|
209
|
209
|
} |
|
210
|
210
|
|
|
@@ -221,76 +221,76 @@ discard block |
|
|
block discarded – undo |
|
221
|
221
|
* |
|
222
|
222
|
* @return void |
|
223
|
223
|
*/ |
|
224
|
|
-function give_load_admin_scripts( $hook ) { |
|
|
224
|
+function give_load_admin_scripts($hook) { |
|
225
|
225
|
|
|
226
|
226
|
global $post, $post_type; |
|
227
|
227
|
|
|
228
|
228
|
$give_options = give_get_settings(); |
|
229
|
229
|
|
|
230
|
230
|
// Directories of assets. |
|
231
|
|
- $js_dir = GIVE_PLUGIN_URL . 'assets/js/admin/'; |
|
232
|
|
- $js_plugins = GIVE_PLUGIN_URL . 'assets/js/plugins/'; |
|
233
|
|
- $css_dir = GIVE_PLUGIN_URL . 'assets/css/'; |
|
|
231
|
+ $js_dir = GIVE_PLUGIN_URL.'assets/js/admin/'; |
|
|
232
|
+ $js_plugins = GIVE_PLUGIN_URL.'assets/js/plugins/'; |
|
|
233
|
+ $css_dir = GIVE_PLUGIN_URL.'assets/css/'; |
|
234
|
234
|
|
|
235
|
235
|
// Use minified libraries if SCRIPT_DEBUG is turned off. |
|
236
|
|
- $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
|
|
236
|
+ $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
237
|
237
|
|
|
238
|
238
|
// LTR or RTL files. |
|
239
|
|
- $direction = ( is_rtl() ) ? '-rtl' : ''; |
|
|
239
|
+ $direction = (is_rtl()) ? '-rtl' : ''; |
|
240
|
240
|
|
|
241
|
241
|
// Global Admin. |
|
242
|
|
- wp_register_style( 'give-admin-bar-notification', $css_dir . 'adminbar-style.css' ); |
|
243
|
|
- wp_enqueue_style( 'give-admin-bar-notification' ); |
|
|
242
|
+ wp_register_style('give-admin-bar-notification', $css_dir.'adminbar-style.css'); |
|
|
243
|
+ wp_enqueue_style('give-admin-bar-notification'); |
|
244
|
244
|
|
|
245
|
245
|
// Give Admin Only. |
|
246
|
|
- if ( ! apply_filters( 'give_load_admin_scripts', give_is_admin_page(), $hook ) ) { |
|
|
246
|
+ if ( ! apply_filters('give_load_admin_scripts', give_is_admin_page(), $hook)) { |
|
247
|
247
|
return; |
|
248
|
248
|
} |
|
249
|
249
|
|
|
250
|
250
|
// CSS. |
|
251
|
|
- wp_register_style( 'jquery-ui-css', $css_dir . 'jquery-ui-fresh' . $suffix . '.css' ); |
|
252
|
|
- wp_enqueue_style( 'jquery-ui-css' ); |
|
253
|
|
- wp_register_style( 'give-admin', $css_dir . 'give-admin' . $direction . $suffix . '.css', array(), GIVE_VERSION ); |
|
254
|
|
- wp_enqueue_style( 'give-admin' ); |
|
255
|
|
- wp_register_style( 'jquery-chosen', $css_dir . 'chosen' . $suffix . '.css', array(), GIVE_VERSION ); |
|
256
|
|
- wp_enqueue_style( 'jquery-chosen' ); |
|
257
|
|
- wp_enqueue_style( 'thickbox' ); |
|
258
|
|
- wp_enqueue_style( 'wp-color-picker' ); |
|
|
251
|
+ wp_register_style('jquery-ui-css', $css_dir.'jquery-ui-fresh'.$suffix.'.css'); |
|
|
252
|
+ wp_enqueue_style('jquery-ui-css'); |
|
|
253
|
+ wp_register_style('give-admin', $css_dir.'give-admin'.$direction.$suffix.'.css', array(), GIVE_VERSION); |
|
|
254
|
+ wp_enqueue_style('give-admin'); |
|
|
255
|
+ wp_register_style('jquery-chosen', $css_dir.'chosen'.$suffix.'.css', array(), GIVE_VERSION); |
|
|
256
|
+ wp_enqueue_style('jquery-chosen'); |
|
|
257
|
+ wp_enqueue_style('thickbox'); |
|
|
258
|
+ wp_enqueue_style('wp-color-picker'); |
|
259
|
259
|
|
|
260
|
260
|
|
|
261
|
261
|
// JS. |
|
262
|
|
- wp_register_script( 'jquery-chosen', $js_plugins . 'chosen.jquery' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION ); |
|
263
|
|
- wp_enqueue_script( 'jquery-chosen' ); |
|
|
262
|
+ wp_register_script('jquery-chosen', $js_plugins.'chosen.jquery'.$suffix.'.js', array('jquery'), GIVE_VERSION); |
|
|
263
|
+ wp_enqueue_script('jquery-chosen'); |
|
264
|
264
|
|
|
265
|
|
- wp_register_script( 'give-accounting', $js_plugins . 'accounting' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
266
|
|
- wp_enqueue_script( 'give-accounting' ); |
|
|
265
|
+ wp_register_script('give-accounting', $js_plugins.'accounting'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
|
266
|
+ wp_enqueue_script('give-accounting'); |
|
267
|
267
|
|
|
268
|
|
- wp_enqueue_script( 'wp-color-picker' ); |
|
269
|
|
- wp_enqueue_script( 'jquery-ui-datepicker' ); |
|
270
|
|
- wp_enqueue_script( 'thickbox' ); |
|
|
268
|
+ wp_enqueue_script('wp-color-picker'); |
|
|
269
|
+ wp_enqueue_script('jquery-ui-datepicker'); |
|
|
270
|
+ wp_enqueue_script('thickbox'); |
|
271
|
271
|
|
|
272
|
|
- wp_register_script( 'give-admin-scripts', $js_dir . 'admin-scripts' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker', 'wp-color-picker' ), GIVE_VERSION, false ); |
|
273
|
|
- wp_enqueue_script( 'give-admin-scripts' ); |
|
|
272
|
+ wp_register_script('give-admin-scripts', $js_dir.'admin-scripts'.$suffix.'.js', array('jquery', 'jquery-ui-datepicker', 'wp-color-picker'), GIVE_VERSION, false); |
|
|
273
|
+ wp_enqueue_script('give-admin-scripts'); |
|
274
|
274
|
|
|
275
|
|
- wp_register_script( 'jquery-flot', $js_plugins . 'jquery.flot' . $suffix . '.js' ); |
|
276
|
|
- wp_enqueue_script( 'jquery-flot' ); |
|
|
275
|
+ wp_register_script('jquery-flot', $js_plugins.'jquery.flot'.$suffix.'.js'); |
|
|
276
|
+ wp_enqueue_script('jquery-flot'); |
|
277
|
277
|
|
|
278
|
|
- wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
279
|
|
- wp_enqueue_script( 'give-qtip' ); |
|
|
278
|
+ wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
|
279
|
+ wp_enqueue_script('give-qtip'); |
|
280
|
280
|
|
|
281
|
|
- wp_register_script( 'give-repeatable-fields', $js_plugins . 'repeatable-fields' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
282
|
|
- wp_enqueue_script( 'give-repeatable-fields' ); |
|
|
281
|
+ wp_register_script('give-repeatable-fields', $js_plugins.'repeatable-fields'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
|
282
|
+ wp_enqueue_script('give-repeatable-fields'); |
|
283
|
283
|
|
|
284
|
284
|
// Forms CPT Script. |
|
285
|
|
- if ( $post_type === 'give_forms' ) { |
|
286
|
|
- wp_register_script( 'give-admin-forms-scripts', $js_dir . 'admin-forms' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
287
|
|
- wp_enqueue_script( 'give-admin-forms-scripts' ); |
|
|
285
|
+ if ($post_type === 'give_forms') { |
|
|
286
|
+ wp_register_script('give-admin-forms-scripts', $js_dir.'admin-forms'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
|
287
|
+ wp_enqueue_script('give-admin-forms-scripts'); |
|
288
|
288
|
} |
|
289
|
289
|
|
|
290
|
290
|
// Settings Scripts. |
|
291
|
|
- if ( isset( $_GET['page'] ) && $_GET['page'] == 'give-settings' ) { |
|
292
|
|
- wp_register_script( 'give-admin-settings-scripts', $js_dir . 'admin-settings' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
293
|
|
- wp_enqueue_script( 'give-admin-settings-scripts' ); |
|
|
291
|
+ if (isset($_GET['page']) && $_GET['page'] == 'give-settings') { |
|
|
292
|
+ wp_register_script('give-admin-settings-scripts', $js_dir.'admin-settings'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
|
293
|
+ wp_enqueue_script('give-admin-settings-scripts'); |
|
294
|
294
|
} |
|
295
|
295
|
|
|
296
|
296
|
// Price Separators. |
|
@@ -298,62 +298,62 @@ discard block |
|
|
block discarded – undo |
|
298
|
298
|
$decimal_separator = give_get_price_decimal_separator(); |
|
299
|
299
|
|
|
300
|
300
|
// Localize strings & variables for JS. |
|
301
|
|
- wp_localize_script( 'give-admin-scripts', 'give_vars', array( |
|
302
|
|
- 'post_id' => isset( $post->ID ) ? $post->ID : null, |
|
|
301
|
+ wp_localize_script('give-admin-scripts', 'give_vars', array( |
|
|
302
|
+ 'post_id' => isset($post->ID) ? $post->ID : null, |
|
303
|
303
|
'give_version' => GIVE_VERSION, |
|
304
|
304
|
'thousands_separator' => $thousand_separator, |
|
305
|
305
|
'decimal_separator' => $decimal_separator, |
|
306
|
|
- 'quick_edit_warning' => __( 'Not available for variable priced forms.', 'give' ), |
|
307
|
|
- 'delete_payment' => __( 'Are you sure you wish to delete this payment?', 'give' ), |
|
308
|
|
- 'delete_payment_note' => __( 'Are you sure you wish to delete this note?', 'give' ), |
|
309
|
|
- 'revoke_api_key' => __( 'Are you sure you wish to revoke this API key?', 'give' ), |
|
310
|
|
- 'regenerate_api_key' => __( 'Are you sure you wish to regenerate this API key?', 'give' ), |
|
311
|
|
- 'resend_receipt' => __( 'Are you sure you wish to resend the donation receipt?', 'give' ), |
|
312
|
|
- 'disconnect_user' => __( 'Are you sure you want to disconnect User from this Donor?', 'give' ), |
|
313
|
|
- 'reconnect_user' => __( 'Want to reconnect with user', 'give' ), |
|
314
|
|
- 'reconnect_label' => __( 'Reconnect Now', 'give' ), |
|
315
|
|
- 'logo' => __( 'Logo', 'give' ), |
|
316
|
|
- 'use_this_image' => __( 'Use this image', 'give' ), |
|
317
|
|
- 'one_option' => __( 'Choose a form', 'give' ), |
|
318
|
|
- 'one_or_more_option' => __( 'Choose one or more forms', 'give' ), |
|
319
|
|
- 'currency_sign' => give_currency_filter( '' ), |
|
320
|
|
- 'currency_pos' => isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before', |
|
321
|
|
- 'currency_decimals' => give_currency_decimal_filter( give_get_price_decimals() ), |
|
322
|
|
- 'batch_export_no_class' => __( 'You must choose a method.', 'give' ), |
|
323
|
|
- 'batch_export_no_reqs' => __( 'Required fields not completed.', 'give' ), |
|
324
|
|
- 'reset_stats_warn' => __( 'Are you sure you want to reset Give? This process is <strong><em>not reversible</em></strong> and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give' ), |
|
325
|
|
- 'price_format_guide' => sprintf( __( 'Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give' ), $decimal_separator, $thousand_separator ), |
|
|
306
|
+ 'quick_edit_warning' => __('Not available for variable priced forms.', 'give'), |
|
|
307
|
+ 'delete_payment' => __('Are you sure you wish to delete this payment?', 'give'), |
|
|
308
|
+ 'delete_payment_note' => __('Are you sure you wish to delete this note?', 'give'), |
|
|
309
|
+ 'revoke_api_key' => __('Are you sure you wish to revoke this API key?', 'give'), |
|
|
310
|
+ 'regenerate_api_key' => __('Are you sure you wish to regenerate this API key?', 'give'), |
|
|
311
|
+ 'resend_receipt' => __('Are you sure you wish to resend the donation receipt?', 'give'), |
|
|
312
|
+ 'disconnect_user' => __('Are you sure you want to disconnect User from this Donor?', 'give'), |
|
|
313
|
+ 'reconnect_user' => __('Want to reconnect with user', 'give'), |
|
|
314
|
+ 'reconnect_label' => __('Reconnect Now', 'give'), |
|
|
315
|
+ 'logo' => __('Logo', 'give'), |
|
|
316
|
+ 'use_this_image' => __('Use this image', 'give'), |
|
|
317
|
+ 'one_option' => __('Choose a form', 'give'), |
|
|
318
|
+ 'one_or_more_option' => __('Choose one or more forms', 'give'), |
|
|
319
|
+ 'currency_sign' => give_currency_filter(''), |
|
|
320
|
+ 'currency_pos' => isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before', |
|
|
321
|
+ 'currency_decimals' => give_currency_decimal_filter(give_get_price_decimals()), |
|
|
322
|
+ 'batch_export_no_class' => __('You must choose a method.', 'give'), |
|
|
323
|
+ 'batch_export_no_reqs' => __('Required fields not completed.', 'give'), |
|
|
324
|
+ 'reset_stats_warn' => __('Are you sure you want to reset Give? This process is <strong><em>not reversible</em></strong> and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give'), |
|
|
325
|
+ 'price_format_guide' => sprintf(__('Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give'), $decimal_separator, $thousand_separator), |
|
326
|
326
|
/* translators : %s: Donation form options metabox */ |
|
327
|
|
- 'confirm_before_remove_row_text' => __( 'Do you want to delete this level?', 'give' ), |
|
328
|
|
- 'matched_success_failure_page' => __( 'You cannot set the success and failed pages to the same page', 'give' ), |
|
329
|
|
- 'dismiss_notice_text' => __( 'Dismiss this notice.', 'give' ), |
|
|
327
|
+ 'confirm_before_remove_row_text' => __('Do you want to delete this level?', 'give'), |
|
|
328
|
+ 'matched_success_failure_page' => __('You cannot set the success and failed pages to the same page', 'give'), |
|
|
329
|
+ 'dismiss_notice_text' => __('Dismiss this notice.', 'give'), |
|
330
|
330
|
'bulk_action' => array( |
|
331
|
331
|
'delete' => array( |
|
332
|
|
- 'zero_payment_selected' => __( 'You must choose at least one or more payments to delete.', 'give' ), |
|
333
|
|
- 'delete_payment' => __( 'Are you sure you want to permanently delete this donation?', 'give' ), |
|
334
|
|
- 'delete_payments' => __( 'Are you sure you want to permanently delete the selected {payment_count} donations?', 'give' ), |
|
|
332
|
+ 'zero_payment_selected' => __('You must choose at least one or more payments to delete.', 'give'), |
|
|
333
|
+ 'delete_payment' => __('Are you sure you want to permanently delete this donation?', 'give'), |
|
|
334
|
+ 'delete_payments' => __('Are you sure you want to permanently delete the selected {payment_count} donations?', 'give'), |
|
335
|
335
|
), |
|
336
|
336
|
'resend_receipt' => array( |
|
337
|
|
- 'zero_recipient_selected' => __( 'You must choose at least one or more recipients to resend the email receipt.', 'give' ), |
|
338
|
|
- 'resend_receipt' => __( 'Are you sure you want to resend the email receipt to this recipient?', 'give' ), |
|
339
|
|
- 'resend_receipts' => __( 'Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give' ), |
|
|
337
|
+ 'zero_recipient_selected' => __('You must choose at least one or more recipients to resend the email receipt.', 'give'), |
|
|
338
|
+ 'resend_receipt' => __('Are you sure you want to resend the email receipt to this recipient?', 'give'), |
|
|
339
|
+ 'resend_receipts' => __('Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give'), |
|
340
|
340
|
), |
|
341
|
341
|
), |
|
342
|
342
|
'metabox_fields' => array( |
|
343
|
343
|
'media' => array( |
|
344
|
|
- 'button_title' => esc_html__( 'Choose Attachment', 'give' ), |
|
|
344
|
+ 'button_title' => esc_html__('Choose Attachment', 'give'), |
|
345
|
345
|
) |
|
346
|
346
|
) |
|
347
|
|
- ) ); |
|
|
347
|
+ )); |
|
348
|
348
|
|
|
349
|
|
- if ( function_exists( 'wp_enqueue_media' ) && version_compare( get_bloginfo( 'version' ), '3.5', '>=' ) ) { |
|
|
349
|
+ if (function_exists('wp_enqueue_media') && version_compare(get_bloginfo('version'), '3.5', '>=')) { |
|
350
|
350
|
// call for new media manager. |
|
351
|
351
|
wp_enqueue_media(); |
|
352
|
352
|
} |
|
353
|
353
|
|
|
354
|
354
|
} |
|
355
|
355
|
|
|
356
|
|
-add_action( 'admin_enqueue_scripts', 'give_load_admin_scripts', 100 ); |
|
|
356
|
+add_action('admin_enqueue_scripts', 'give_load_admin_scripts', 100); |
|
357
|
357
|
|
|
358
|
358
|
/** |
|
359
|
359
|
* Admin Give Icon |
|
@@ -368,13 +368,13 @@ discard block |
|
|
block discarded – undo |
|
368
|
368
|
?> |
|
369
|
369
|
<style type="text/css" media="screen"> |
|
370
|
370
|
|
|
371
|
|
- <?php if ( version_compare( get_bloginfo( 'version' ), '3.8-RC', '>=' ) || version_compare( get_bloginfo( 'version' ), '3.8', '>=' ) ) { ?> |
|
|
371
|
+ <?php if (version_compare(get_bloginfo('version'), '3.8-RC', '>=') || version_compare(get_bloginfo('version'), '3.8', '>=')) { ?> |
|
372
|
372
|
@font-face { |
|
373
|
373
|
font-family: 'give-icomoon'; |
|
374
|
|
- src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?ngjl88'; ?>'); |
|
375
|
|
- src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'), |
|
376
|
|
- url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.woff?ngjl88'; ?>') format('woff'), |
|
377
|
|
- url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg'); |
|
|
374
|
+ src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?ngjl88'; ?>'); |
|
|
375
|
+ src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'), |
|
|
376
|
+ url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.woff?ngjl88'; ?>') format('woff'), |
|
|
377
|
+ url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg'); |
|
378
|
378
|
font-weight: normal; |
|
379
|
379
|
font-style: normal; |
|
380
|
380
|
} |
|
@@ -393,7 +393,7 @@ discard block |
|
|
block discarded – undo |
|
393
|
393
|
<?php |
|
394
|
394
|
} |
|
395
|
395
|
|
|
396
|
|
-add_action( 'admin_head', 'give_admin_icon' ); |
|
|
396
|
+add_action('admin_head', 'give_admin_icon'); |
|
397
|
397
|
|
|
398
|
398
|
/** |
|
399
|
399
|
* Admin js code |
|
@@ -423,4 +423,4 @@ discard block |
|
|
block discarded – undo |
|
423
|
423
|
<?php |
|
424
|
424
|
} |
|
425
|
425
|
|
|
426
|
|
-add_action( 'admin_head', 'give_admin_hide_notice_shortly_js' ); |
|
|
426
|
+add_action('admin_head', 'give_admin_hide_notice_shortly_js'); |