Completed
Push — master ( 0af146...0e0d02 )
by Devin
13s
created
includes/scripts.php 1 patch
Spacing   +152 added lines, -152 removed lines patch added patch discarded remove patch
@@ -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_get_option( 'scripts_footer' ) == 'on' ) ? true : false;
28
+	$js_dir         = GIVE_PLUGIN_URL.'assets/js/frontend/';
29
+	$js_plugins     = GIVE_PLUGIN_URL.'assets/js/plugins/';
30
+	$scripts_footer = (give_get_option('scripts_footer') == 'on') ? 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,73 +221,73 @@  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' );
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 258
 
259 259
 	// JS.
260
-	wp_register_script( 'jquery-chosen', $js_plugins . 'chosen.jquery' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION );
261
-	wp_enqueue_script( 'jquery-chosen' );
260
+	wp_register_script('jquery-chosen', $js_plugins.'chosen.jquery'.$suffix.'.js', array('jquery'), GIVE_VERSION);
261
+	wp_enqueue_script('jquery-chosen');
262 262
 
263
-	wp_register_script( 'give-accounting', $js_plugins . 'accounting' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
264
-	wp_enqueue_script( 'give-accounting' );
263
+	wp_register_script('give-accounting', $js_plugins.'accounting'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
264
+	wp_enqueue_script('give-accounting');
265 265
 
266
-	wp_register_script( 'give-admin-scripts', $js_dir . 'admin-scripts' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
267
-	wp_enqueue_script( 'give-admin-scripts' );
266
+	wp_register_script('give-admin-scripts', $js_dir.'admin-scripts'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
267
+	wp_enqueue_script('give-admin-scripts');
268 268
 
269
-	wp_register_script( 'jquery-flot', $js_plugins . 'jquery.flot' . $suffix . '.js' );
270
-	wp_enqueue_script( 'jquery-flot' );
269
+	wp_register_script('jquery-flot', $js_plugins.'jquery.flot'.$suffix.'.js');
270
+	wp_enqueue_script('jquery-flot');
271 271
 
272
-	wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
273
-	wp_enqueue_script( 'give-qtip' );
272
+	wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
273
+	wp_enqueue_script('give-qtip');
274 274
 
275
-	wp_register_script( 'give-repeatable-fields', $js_plugins . 'repeatable-fields' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
276
-	wp_enqueue_script( 'give-repeatable-fields' );
275
+	wp_register_script('give-repeatable-fields', $js_plugins.'repeatable-fields'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
276
+	wp_enqueue_script('give-repeatable-fields');
277 277
 
278
-	wp_enqueue_script( 'jquery-ui-datepicker' );
279
-	wp_enqueue_script( 'thickbox' );
278
+	wp_enqueue_script('jquery-ui-datepicker');
279
+	wp_enqueue_script('thickbox');
280 280
 
281 281
 	// Forms CPT Script.
282
-	if ( $post_type === 'give_forms' ) {
283
-		wp_register_script( 'give-admin-forms-scripts', $js_dir . 'admin-forms' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
284
-		wp_enqueue_script( 'give-admin-forms-scripts' );
282
+	if ($post_type === 'give_forms') {
283
+		wp_register_script('give-admin-forms-scripts', $js_dir.'admin-forms'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
284
+		wp_enqueue_script('give-admin-forms-scripts');
285 285
 	}
286 286
 
287 287
 	// Settings Scripts.
288
-	if ( isset( $_GET['page'] ) && $_GET['page'] == 'give-settings' ) {
289
-		wp_register_script( 'give-admin-settings-scripts', $js_dir . 'admin-settings' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
290
-		wp_enqueue_script( 'give-admin-settings-scripts' );
288
+	if (isset($_GET['page']) && $_GET['page'] == 'give-settings') {
289
+		wp_register_script('give-admin-settings-scripts', $js_dir.'admin-settings'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
290
+		wp_enqueue_script('give-admin-settings-scripts');
291 291
 	}
292 292
 
293 293
 	// Price Separators.
@@ -295,60 +295,60 @@  discard block
 block discarded – undo
295 295
 	$decimal_separator  = give_get_price_decimal_separator();
296 296
 
297 297
 	// Localize strings & variables for JS.
298
-	wp_localize_script( 'give-admin-scripts', 'give_vars', array(
299
-		'post_id'                        => isset( $post->ID ) ? $post->ID : null,
298
+	wp_localize_script('give-admin-scripts', 'give_vars', array(
299
+		'post_id'                        => isset($post->ID) ? $post->ID : null,
300 300
 		'give_version'                   => GIVE_VERSION,
301 301
 		'thousands_separator'            => $thousand_separator,
302 302
 		'decimal_separator'              => $decimal_separator,
303
-		'quick_edit_warning'             => __( 'Not available for variable priced forms.', 'give' ),
304
-		'delete_payment'                 => __( 'Are you sure you wish to delete this payment?', 'give' ),
305
-		'delete_payment_note'            => __( 'Are you sure you wish to delete this note?', 'give' ),
306
-		'revoke_api_key'                 => __( 'Are you sure you wish to revoke this API key?', 'give' ),
307
-		'regenerate_api_key'             => __( 'Are you sure you wish to regenerate this API key?', 'give' ),
308
-		'resend_receipt'                 => __( 'Are you sure you wish to resend the donation receipt?', 'give' ),
309
-		'logo'                           => __( 'Logo', 'give' ),
310
-		'use_this_image'                 => __( 'Use this image', 'give' ),
311
-		'one_option'                     => __( 'Choose a form', 'give' ),
312
-		'one_or_more_option'             => __( 'Choose one or more forms', 'give' ),
313
-		'currency_sign'                  => give_currency_filter( '' ),
314
-		'currency_pos'                   => isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before',
315
-		'currency_decimals'              => give_currency_decimal_filter( give_get_price_decimals() ),
316
-		'batch_export_no_class'          => __( 'You must choose a method.', 'give' ),
317
-		'batch_export_no_reqs'           => __( 'Required fields not completed.', 'give' ),
318
-		'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' ),
319
-		'price_format_guide'             => sprintf( __( 'Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give' ), $decimal_separator, $thousand_separator ),
303
+		'quick_edit_warning'             => __('Not available for variable priced forms.', 'give'),
304
+		'delete_payment'                 => __('Are you sure you wish to delete this payment?', 'give'),
305
+		'delete_payment_note'            => __('Are you sure you wish to delete this note?', 'give'),
306
+		'revoke_api_key'                 => __('Are you sure you wish to revoke this API key?', 'give'),
307
+		'regenerate_api_key'             => __('Are you sure you wish to regenerate this API key?', 'give'),
308
+		'resend_receipt'                 => __('Are you sure you wish to resend the donation receipt?', 'give'),
309
+		'logo'                           => __('Logo', 'give'),
310
+		'use_this_image'                 => __('Use this image', 'give'),
311
+		'one_option'                     => __('Choose a form', 'give'),
312
+		'one_or_more_option'             => __('Choose one or more forms', 'give'),
313
+		'currency_sign'                  => give_currency_filter(''),
314
+		'currency_pos'                   => isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before',
315
+		'currency_decimals'              => give_currency_decimal_filter(give_get_price_decimals()),
316
+		'batch_export_no_class'          => __('You must choose a method.', 'give'),
317
+		'batch_export_no_reqs'           => __('Required fields not completed.', 'give'),
318
+		'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'),
319
+		'price_format_guide'             => sprintf(__('Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give'), $decimal_separator, $thousand_separator),
320 320
 		/* translators : %s: Donation form options metabox */
321
-		'confirm_before_remove_row_text' => __( 'Do you want to delete this level?', 'give' ),
322
-		'matched_success_failure_page'   => __( 'You cannot set the success and failed pages to the same page', 'give' ),
323
-		'dismiss_notice_text'            => __( 'Dismiss this notice.', 'give' ),
321
+		'confirm_before_remove_row_text' => __('Do you want to delete this level?', 'give'),
322
+		'matched_success_failure_page'   => __('You cannot set the success and failed pages to the same page', 'give'),
323
+		'dismiss_notice_text'            => __('Dismiss this notice.', 'give'),
324 324
 		'bulk_action' => array(
325 325
 			'delete'         => array(
326
-				'zero_payment_selected' => __( 'You must choose at least one or more payments to delete.', 'give' ),
327
-				'delete_payment'        => __( 'Are you sure you want to permanently delete this donation?', 'give' ),
328
-				'delete_payments'       => __( 'Are you sure you want to permanently delete the selected {payment_count} donations?', 'give' ),
326
+				'zero_payment_selected' => __('You must choose at least one or more payments to delete.', 'give'),
327
+				'delete_payment'        => __('Are you sure you want to permanently delete this donation?', 'give'),
328
+				'delete_payments'       => __('Are you sure you want to permanently delete the selected {payment_count} donations?', 'give'),
329 329
 			),
330 330
 			'resend_receipt' => array(
331
-				'zero_recipient_selected' => __( 'You must choose at least one or more recipients to resend the email receipt.', 'give' ),
332
-				'resend_receipt'          => __( 'Are you sure you want to resend the email receipt to this recipient?', 'give' ),
333
-				'resend_receipts'         => __( 'Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give' ),
331
+				'zero_recipient_selected' => __('You must choose at least one or more recipients to resend the email receipt.', 'give'),
332
+				'resend_receipt'          => __('Are you sure you want to resend the email receipt to this recipient?', 'give'),
333
+				'resend_receipts'         => __('Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give'),
334 334
 			),
335 335
 		),
336
-		'upgrade_confirmation' => __( 'Please make sure to create a database backup before initiating the upgrade.', 'give' ),
336
+		'upgrade_confirmation' => __('Please make sure to create a database backup before initiating the upgrade.', 'give'),
337 337
 		'metabox_fields' => array(
338 338
 			'media' => array(
339
-				'button_title' => esc_html__( 'Choose Attachment', 'give' ),
339
+				'button_title' => esc_html__('Choose Attachment', 'give'),
340 340
 			)
341 341
 		)
342
-	) );
342
+	));
343 343
 
344
-	if ( function_exists( 'wp_enqueue_media' ) && version_compare( get_bloginfo( 'version' ), '3.5', '>=' ) ) {
344
+	if (function_exists('wp_enqueue_media') && version_compare(get_bloginfo('version'), '3.5', '>=')) {
345 345
 		// call for new media manager.
346 346
 		wp_enqueue_media();
347 347
 	}
348 348
 
349 349
 }
350 350
 
351
-add_action( 'admin_enqueue_scripts', 'give_load_admin_scripts', 100 );
351
+add_action('admin_enqueue_scripts', 'give_load_admin_scripts', 100);
352 352
 
353 353
 /**
354 354
  * Admin Give Icon
@@ -363,13 +363,13 @@  discard block
 block discarded – undo
363 363
 	?>
364 364
     <style type="text/css" media="screen">
365 365
 
366
-        <?php if ( version_compare( get_bloginfo( 'version' ), '3.8-RC', '>=' ) || version_compare( get_bloginfo( 'version' ), '3.8', '>=' ) ) { ?>
366
+        <?php if (version_compare(get_bloginfo('version'), '3.8-RC', '>=') || version_compare(get_bloginfo('version'), '3.8', '>=')) { ?>
367 367
         @font-face {
368 368
             font-family: 'give-icomoon';
369
-            src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?-ngjl88'; ?>');
370
-            src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?#iefix-ngjl88'?>') format('embedded-opentype'),
371
-            url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.woff?-ngjl88'; ?>') format('woff'),
372
-            url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.svg?-ngjl88#icomoon'; ?>') format('svg');
369
+            src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?-ngjl88'; ?>');
370
+            src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?#iefix-ngjl88'?>') format('embedded-opentype'),
371
+            url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.woff?-ngjl88'; ?>') format('woff'),
372
+            url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.svg?-ngjl88#icomoon'; ?>') format('svg');
373 373
             font-weight: normal;
374 374
             font-style: normal;
375 375
         }
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 	<?php
389 389
 }
390 390
 
391
-add_action( 'admin_head', 'give_admin_icon' );
391
+add_action('admin_head', 'give_admin_icon');
392 392
 
393 393
 /**
394 394
  * Admin js code
@@ -418,4 +418,4 @@  discard block
 block discarded – undo
418 418
 	<?php
419 419
 }
420 420
 
421
-add_action( 'admin_head', 'give_admin_hide_notice_shortly_js' );
421
+add_action('admin_head', 'give_admin_hide_notice_shortly_js');
Please login to merge, or discard this patch.