@@ -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 | |
@@ -28,94 +28,94 @@ discard block |
||
28 | 28 | |
29 | 29 | global $give_options; |
30 | 30 | |
31 | - $js_dir = GIVE_PLUGIN_URL . 'assets/js/frontend/'; |
|
32 | - $js_plugins = GIVE_PLUGIN_URL . 'assets/js/plugins/'; |
|
33 | - $scripts_footer = ( give_get_option( 'scripts_footer' ) == 'on' ) ? true : false; |
|
31 | + $js_dir = GIVE_PLUGIN_URL.'assets/js/frontend/'; |
|
32 | + $js_plugins = GIVE_PLUGIN_URL.'assets/js/plugins/'; |
|
33 | + $scripts_footer = (give_get_option('scripts_footer') == 'on') ? true : false; |
|
34 | 34 | |
35 | 35 | // Use minified libraries if SCRIPT_DEBUG is turned off |
36 | - $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
|
36 | + $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
37 | 37 | |
38 | 38 | //Localize / PHP to AJAX vars |
39 | - $localize_give_checkout = apply_filters( 'give_global_script_vars', array( |
|
39 | + $localize_give_checkout = apply_filters('give_global_script_vars', array( |
|
40 | 40 | 'ajaxurl' => give_get_ajax_url(), |
41 | - 'checkout_nonce' => wp_create_nonce( 'give_checkout_nonce' ), |
|
42 | - 'currency_sign' => give_currency_filter( '' ), |
|
41 | + 'checkout_nonce' => wp_create_nonce('give_checkout_nonce'), |
|
42 | + 'currency_sign' => give_currency_filter(''), |
|
43 | 43 | 'currency_pos' => give_get_currency_position(), |
44 | - 'thousands_separator' => isset( $give_options['thousands_separator'] ) ? $give_options['thousands_separator'] : ',', |
|
45 | - 'decimal_separator' => isset( $give_options['decimal_separator'] ) ? $give_options['decimal_separator'] : '.', |
|
46 | - 'no_gateway' => esc_html( 'Please select a payment method.', 'give' ), |
|
47 | - 'bad_minimum' => esc_html( 'The minimum donation amount for this form is', 'give' ), |
|
48 | - 'general_loading' => esc_html( 'Loading...', 'give' ), |
|
49 | - 'purchase_loading' => esc_html( 'Please Wait...', 'give' ), |
|
50 | - 'number_decimals' => apply_filters( 'give_format_amount_decimals', 2 ), |
|
44 | + 'thousands_separator' => isset($give_options['thousands_separator']) ? $give_options['thousands_separator'] : ',', |
|
45 | + 'decimal_separator' => isset($give_options['decimal_separator']) ? $give_options['decimal_separator'] : '.', |
|
46 | + 'no_gateway' => esc_html('Please select a payment method.', 'give'), |
|
47 | + 'bad_minimum' => esc_html('The minimum donation amount for this form is', 'give'), |
|
48 | + 'general_loading' => esc_html('Loading...', 'give'), |
|
49 | + 'purchase_loading' => esc_html('Please Wait...', 'give'), |
|
50 | + 'number_decimals' => apply_filters('give_format_amount_decimals', 2), |
|
51 | 51 | 'give_version' => GIVE_VERSION |
52 | - ) ); |
|
53 | - $localize_give_ajax = apply_filters( 'give_global_ajax_vars', array( |
|
52 | + )); |
|
53 | + $localize_give_ajax = apply_filters('give_global_ajax_vars', array( |
|
54 | 54 | 'ajaxurl' => give_get_ajax_url(), |
55 | - 'loading' => esc_html( 'Loading', 'give' ), |
|
55 | + 'loading' => esc_html('Loading', 'give'), |
|
56 | 56 | // General loading message |
57 | - 'select_option' => esc_html( 'Please select an option', 'give' ), |
|
57 | + 'select_option' => esc_html('Please select an option', 'give'), |
|
58 | 58 | // Variable pricing error with multi-purchase option enabled |
59 | - 'default_gateway' => give_get_default_gateway( null ), |
|
60 | - 'permalinks' => get_option( 'permalink_structure' ) ? '1' : '0', |
|
61 | - 'number_decimals' => apply_filters( 'give_format_amount_decimals', 2 ) |
|
62 | - ) ); |
|
59 | + 'default_gateway' => give_get_default_gateway(null), |
|
60 | + 'permalinks' => get_option('permalink_structure') ? '1' : '0', |
|
61 | + 'number_decimals' => apply_filters('give_format_amount_decimals', 2) |
|
62 | + )); |
|
63 | 63 | |
64 | 64 | //DEBUG is On |
65 | - if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { |
|
65 | + if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) { |
|
66 | 66 | |
67 | - if ( give_is_cc_verify_enabled() ) { |
|
68 | - wp_register_script( 'give-cc-validator', $js_plugins . 'jquery.payment' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
69 | - wp_enqueue_script( 'give-cc-validator' ); |
|
67 | + if (give_is_cc_verify_enabled()) { |
|
68 | + wp_register_script('give-cc-validator', $js_plugins.'jquery.payment'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
69 | + wp_enqueue_script('give-cc-validator'); |
|
70 | 70 | } |
71 | 71 | |
72 | - wp_register_script( 'give-float-labels', $js_plugins . 'float-labels' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
73 | - wp_enqueue_script( 'give-float-labels' ); |
|
72 | + wp_register_script('give-float-labels', $js_plugins.'float-labels'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
73 | + wp_enqueue_script('give-float-labels'); |
|
74 | 74 | |
75 | - wp_register_script( 'give-blockui', $js_plugins . 'jquery.blockUI' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
76 | - wp_enqueue_script( 'give-blockui' ); |
|
75 | + wp_register_script('give-blockui', $js_plugins.'jquery.blockUI'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
76 | + wp_enqueue_script('give-blockui'); |
|
77 | 77 | |
78 | - wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
79 | - wp_enqueue_script( 'give-qtip' ); |
|
78 | + wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
79 | + wp_enqueue_script('give-qtip'); |
|
80 | 80 | |
81 | - wp_register_script( 'give-accounting', $js_plugins . 'accounting' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
82 | - wp_enqueue_script( 'give-accounting' ); |
|
81 | + wp_register_script('give-accounting', $js_plugins.'accounting'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
82 | + wp_enqueue_script('give-accounting'); |
|
83 | 83 | |
84 | - wp_register_script( 'give-magnific', $js_plugins . 'jquery.magnific-popup' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
85 | - wp_enqueue_script( 'give-magnific' ); |
|
84 | + wp_register_script('give-magnific', $js_plugins.'jquery.magnific-popup'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
85 | + wp_enqueue_script('give-magnific'); |
|
86 | 86 | |
87 | - wp_register_script( 'give-checkout-global', $js_dir . 'give-checkout-global' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
88 | - wp_enqueue_script( 'give-checkout-global' ); |
|
87 | + wp_register_script('give-checkout-global', $js_dir.'give-checkout-global'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
88 | + wp_enqueue_script('give-checkout-global'); |
|
89 | 89 | |
90 | 90 | //General scripts |
91 | - wp_register_script( 'give-scripts', $js_dir . 'give' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
92 | - wp_enqueue_script( 'give-scripts' ); |
|
91 | + wp_register_script('give-scripts', $js_dir.'give'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
92 | + wp_enqueue_script('give-scripts'); |
|
93 | 93 | |
94 | 94 | // Load AJAX scripts, if enabled |
95 | - wp_register_script( 'give-ajax', $js_dir . 'give-ajax' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
96 | - wp_enqueue_script( 'give-ajax' ); |
|
95 | + wp_register_script('give-ajax', $js_dir.'give-ajax'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
96 | + wp_enqueue_script('give-ajax'); |
|
97 | 97 | |
98 | 98 | //Localize / Pass AJAX vars from PHP |
99 | - wp_localize_script( 'give-checkout-global', 'give_global_vars', $localize_give_checkout ); |
|
100 | - wp_localize_script( 'give-ajax', 'give_scripts', $localize_give_ajax ); |
|
99 | + wp_localize_script('give-checkout-global', 'give_global_vars', $localize_give_checkout); |
|
100 | + wp_localize_script('give-ajax', 'give_scripts', $localize_give_ajax); |
|
101 | 101 | |
102 | 102 | |
103 | 103 | } else { |
104 | 104 | |
105 | 105 | //DEBUG is OFF (one JS file to rule them all!) |
106 | - wp_register_script( 'give', $js_dir . 'give.all.min.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
107 | - wp_enqueue_script( 'give' ); |
|
106 | + wp_register_script('give', $js_dir.'give.all.min.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
107 | + wp_enqueue_script('give'); |
|
108 | 108 | |
109 | 109 | //Localize / Pass AJAX vars from PHP |
110 | - wp_localize_script( 'give', 'give_global_vars', $localize_give_checkout ); |
|
111 | - wp_localize_script( 'give', 'give_scripts', $localize_give_ajax ); |
|
110 | + wp_localize_script('give', 'give_global_vars', $localize_give_checkout); |
|
111 | + wp_localize_script('give', 'give_scripts', $localize_give_ajax); |
|
112 | 112 | |
113 | 113 | } |
114 | 114 | |
115 | 115 | |
116 | 116 | } |
117 | 117 | |
118 | -add_action( 'wp_enqueue_scripts', 'give_load_scripts' ); |
|
118 | +add_action('wp_enqueue_scripts', 'give_load_scripts'); |
|
119 | 119 | |
120 | 120 | /** |
121 | 121 | * Register Styles |
@@ -127,47 +127,47 @@ discard block |
||
127 | 127 | */ |
128 | 128 | function give_register_styles() { |
129 | 129 | |
130 | - if ( give_get_option( 'disable_css', false ) ) { |
|
130 | + if (give_get_option('disable_css', false)) { |
|
131 | 131 | return; |
132 | 132 | } |
133 | 133 | |
134 | 134 | // Use minified libraries if SCRIPT_DEBUG is turned off |
135 | - $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
|
135 | + $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
136 | 136 | |
137 | - $file = 'give' . $suffix . '.css'; |
|
137 | + $file = 'give'.$suffix.'.css'; |
|
138 | 138 | $templates_dir = give_get_theme_template_dir_name(); |
139 | 139 | |
140 | - $child_theme_style_sheet = trailingslashit( get_stylesheet_directory() ) . $templates_dir . $file; |
|
141 | - $child_theme_style_sheet_2 = trailingslashit( get_stylesheet_directory() ) . $templates_dir . 'give.css'; |
|
142 | - $parent_theme_style_sheet = trailingslashit( get_template_directory() ) . $templates_dir . $file; |
|
143 | - $parent_theme_style_sheet_2 = trailingslashit( get_template_directory() ) . $templates_dir . 'give.css'; |
|
144 | - $give_plugin_style_sheet = trailingslashit( give_get_templates_dir() ) . $file; |
|
140 | + $child_theme_style_sheet = trailingslashit(get_stylesheet_directory()).$templates_dir.$file; |
|
141 | + $child_theme_style_sheet_2 = trailingslashit(get_stylesheet_directory()).$templates_dir.'give.css'; |
|
142 | + $parent_theme_style_sheet = trailingslashit(get_template_directory()).$templates_dir.$file; |
|
143 | + $parent_theme_style_sheet_2 = trailingslashit(get_template_directory()).$templates_dir.'give.css'; |
|
144 | + $give_plugin_style_sheet = trailingslashit(give_get_templates_dir()).$file; |
|
145 | 145 | |
146 | 146 | // Look in the child theme directory first, followed by the parent theme, followed by the Give core templates directory |
147 | 147 | // Also look for the min version first, followed by non minified version, even if SCRIPT_DEBUG is not enabled. |
148 | 148 | // This allows users to copy just give.css to their theme |
149 | - if ( file_exists( $child_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $child_theme_style_sheet_2 ) ) ) ) { |
|
150 | - if ( ! empty( $nonmin ) ) { |
|
151 | - $url = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . 'give.css'; |
|
149 | + if (file_exists($child_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($child_theme_style_sheet_2)))) { |
|
150 | + if ( ! empty($nonmin)) { |
|
151 | + $url = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.'give.css'; |
|
152 | 152 | } else { |
153 | - $url = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . $file; |
|
153 | + $url = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.$file; |
|
154 | 154 | } |
155 | - } elseif ( file_exists( $parent_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $parent_theme_style_sheet_2 ) ) ) ) { |
|
156 | - if ( ! empty( $nonmin ) ) { |
|
157 | - $url = trailingslashit( get_template_directory_uri() ) . $templates_dir . 'give.css'; |
|
155 | + } elseif (file_exists($parent_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($parent_theme_style_sheet_2)))) { |
|
156 | + if ( ! empty($nonmin)) { |
|
157 | + $url = trailingslashit(get_template_directory_uri()).$templates_dir.'give.css'; |
|
158 | 158 | } else { |
159 | - $url = trailingslashit( get_template_directory_uri() ) . $templates_dir . $file; |
|
159 | + $url = trailingslashit(get_template_directory_uri()).$templates_dir.$file; |
|
160 | 160 | } |
161 | - } elseif ( file_exists( $give_plugin_style_sheet ) || file_exists( $give_plugin_style_sheet ) ) { |
|
162 | - $url = trailingslashit( give_get_templates_url() ) . $file; |
|
161 | + } elseif (file_exists($give_plugin_style_sheet) || file_exists($give_plugin_style_sheet)) { |
|
162 | + $url = trailingslashit(give_get_templates_url()).$file; |
|
163 | 163 | } |
164 | 164 | |
165 | - wp_register_style( 'give-styles', $url, array(), GIVE_VERSION, 'all' ); |
|
166 | - wp_enqueue_style( 'give-styles' ); |
|
165 | + wp_register_style('give-styles', $url, array(), GIVE_VERSION, 'all'); |
|
166 | + wp_enqueue_style('give-styles'); |
|
167 | 167 | |
168 | 168 | } |
169 | 169 | |
170 | -add_action( 'wp_enqueue_scripts', 'give_register_styles' ); |
|
170 | +add_action('wp_enqueue_scripts', 'give_register_styles'); |
|
171 | 171 | |
172 | 172 | /** |
173 | 173 | * Load Admin Scripts |
@@ -181,107 +181,107 @@ discard block |
||
181 | 181 | * |
182 | 182 | * @return void |
183 | 183 | */ |
184 | -function give_load_admin_scripts( $hook ) { |
|
184 | +function give_load_admin_scripts($hook) { |
|
185 | 185 | |
186 | 186 | global $wp_version, $post, $post_type; |
187 | 187 | |
188 | 188 | //Directories of assets |
189 | - $js_dir = GIVE_PLUGIN_URL . 'assets/js/admin/'; |
|
190 | - $js_plugins = GIVE_PLUGIN_URL . 'assets/js/plugins/'; |
|
191 | - $css_dir = GIVE_PLUGIN_URL . 'assets/css/'; |
|
189 | + $js_dir = GIVE_PLUGIN_URL.'assets/js/admin/'; |
|
190 | + $js_plugins = GIVE_PLUGIN_URL.'assets/js/plugins/'; |
|
191 | + $css_dir = GIVE_PLUGIN_URL.'assets/css/'; |
|
192 | 192 | |
193 | 193 | // Use minified libraries if SCRIPT_DEBUG is turned off |
194 | - $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
|
194 | + $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
195 | 195 | |
196 | 196 | //Global Admin: |
197 | - wp_register_style( 'give-admin-bar-notification', $css_dir . 'adminbar-style.css' ); |
|
198 | - wp_enqueue_style( 'give-admin-bar-notification' ); |
|
197 | + wp_register_style('give-admin-bar-notification', $css_dir.'adminbar-style.css'); |
|
198 | + wp_enqueue_style('give-admin-bar-notification'); |
|
199 | 199 | |
200 | 200 | //Give Admin Only: |
201 | - if ( ! apply_filters( 'give_load_admin_scripts', give_is_admin_page(), $hook ) ) { |
|
201 | + if ( ! apply_filters('give_load_admin_scripts', give_is_admin_page(), $hook)) { |
|
202 | 202 | return; |
203 | 203 | } |
204 | 204 | |
205 | 205 | //CSS |
206 | - wp_register_style( 'jquery-ui-css', $css_dir . 'jquery-ui-fresh' . $suffix . '.css' ); |
|
207 | - wp_enqueue_style( 'jquery-ui-css' ); |
|
208 | - wp_register_style( 'give-admin', $css_dir . 'give-admin' . $suffix . '.css', GIVE_VERSION ); |
|
209 | - wp_enqueue_style( 'give-admin' ); |
|
210 | - wp_register_style( 'jquery-chosen', $css_dir . 'chosen' . $suffix . '.css', array(), GIVE_VERSION ); |
|
211 | - wp_enqueue_style( 'jquery-chosen' ); |
|
212 | - wp_enqueue_style( 'thickbox' ); |
|
206 | + wp_register_style('jquery-ui-css', $css_dir.'jquery-ui-fresh'.$suffix.'.css'); |
|
207 | + wp_enqueue_style('jquery-ui-css'); |
|
208 | + wp_register_style('give-admin', $css_dir.'give-admin'.$suffix.'.css', GIVE_VERSION); |
|
209 | + wp_enqueue_style('give-admin'); |
|
210 | + wp_register_style('jquery-chosen', $css_dir.'chosen'.$suffix.'.css', array(), GIVE_VERSION); |
|
211 | + wp_enqueue_style('jquery-chosen'); |
|
212 | + wp_enqueue_style('thickbox'); |
|
213 | 213 | |
214 | 214 | //JS |
215 | - wp_register_script( 'jquery-chosen', $js_plugins . 'chosen.jquery' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION ); |
|
216 | - wp_enqueue_script( 'jquery-chosen' ); |
|
215 | + wp_register_script('jquery-chosen', $js_plugins.'chosen.jquery'.$suffix.'.js', array('jquery'), GIVE_VERSION); |
|
216 | + wp_enqueue_script('jquery-chosen'); |
|
217 | 217 | |
218 | - wp_register_script( 'give-admin-scripts', $js_dir . 'admin-scripts' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
219 | - wp_enqueue_script( 'give-admin-scripts' ); |
|
218 | + wp_register_script('give-admin-scripts', $js_dir.'admin-scripts'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
219 | + wp_enqueue_script('give-admin-scripts'); |
|
220 | 220 | |
221 | - wp_register_script( 'jquery-flot', $js_plugins . 'jquery.flot' . $suffix . '.js' ); |
|
222 | - wp_enqueue_script( 'jquery-flot' ); |
|
221 | + wp_register_script('jquery-flot', $js_plugins.'jquery.flot'.$suffix.'.js'); |
|
222 | + wp_enqueue_script('jquery-flot'); |
|
223 | 223 | |
224 | - wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
225 | - wp_enqueue_script( 'give-qtip' ); |
|
224 | + wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
225 | + wp_enqueue_script('give-qtip'); |
|
226 | 226 | |
227 | - wp_enqueue_script( 'jquery-ui-datepicker' ); |
|
228 | - wp_enqueue_script( 'thickbox' ); |
|
227 | + wp_enqueue_script('jquery-ui-datepicker'); |
|
228 | + wp_enqueue_script('thickbox'); |
|
229 | 229 | |
230 | 230 | //Forms CPT Script |
231 | - if ( $post_type === 'give_forms' ) { |
|
232 | - wp_register_script( 'give-admin-forms-scripts', $js_dir . 'admin-forms' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
233 | - wp_enqueue_script( 'give-admin-forms-scripts' ); |
|
231 | + if ($post_type === 'give_forms') { |
|
232 | + wp_register_script('give-admin-forms-scripts', $js_dir.'admin-forms'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
233 | + wp_enqueue_script('give-admin-forms-scripts'); |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | //Settings Scripts |
237 | - if (isset($_GET['page']) && $_GET['page'] == 'give-settings' ) { |
|
237 | + if (isset($_GET['page']) && $_GET['page'] == 'give-settings') { |
|
238 | 238 | wp_enqueue_script('jquery-ui-sortable'); |
239 | - wp_register_script( 'give-admin-settings-scripts', $js_dir . 'admin-settings' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
240 | - wp_enqueue_script( 'give-admin-settings-scripts' ); |
|
239 | + wp_register_script('give-admin-settings-scripts', $js_dir.'admin-settings'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
240 | + wp_enqueue_script('give-admin-settings-scripts'); |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | //Localize strings & variables for JS |
244 | - wp_localize_script( 'give-admin-scripts', 'give_vars', array( |
|
245 | - 'post_id' => isset( $post->ID ) ? $post->ID : null, |
|
244 | + wp_localize_script('give-admin-scripts', 'give_vars', array( |
|
245 | + 'post_id' => isset($post->ID) ? $post->ID : null, |
|
246 | 246 | 'give_version' => GIVE_VERSION, |
247 | - 'quick_edit_warning' => esc_html( 'Sorry, not available for variable priced forms.', 'give' ), |
|
248 | - 'delete_payment' => esc_html( 'Are you sure you wish to delete this payment?', 'give' ), |
|
249 | - 'delete_payment_note' => esc_html( 'Are you sure you wish to delete this note?', 'give' ), |
|
250 | - 'revoke_api_key' => esc_html( 'Are you sure you wish to revoke this API key?', 'give' ), |
|
251 | - 'regenerate_api_key' => esc_html( 'Are you sure you wish to regenerate this API key?', 'give' ), |
|
252 | - 'resend_receipt' => esc_html( 'Are you sure you wish to resend the donation receipt?', 'give' ), |
|
253 | - 'copy_download_link_text' => esc_html( 'Copy these links to your clipboard and give them to your donor.', 'give' ), |
|
247 | + 'quick_edit_warning' => esc_html('Sorry, not available for variable priced forms.', 'give'), |
|
248 | + 'delete_payment' => esc_html('Are you sure you wish to delete this payment?', 'give'), |
|
249 | + 'delete_payment_note' => esc_html('Are you sure you wish to delete this note?', 'give'), |
|
250 | + 'revoke_api_key' => esc_html('Are you sure you wish to revoke this API key?', 'give'), |
|
251 | + 'regenerate_api_key' => esc_html('Are you sure you wish to regenerate this API key?', 'give'), |
|
252 | + 'resend_receipt' => esc_html('Are you sure you wish to resend the donation receipt?', 'give'), |
|
253 | + 'copy_download_link_text' => esc_html('Copy these links to your clipboard and give them to your donor.', 'give'), |
|
254 | 254 | /* translators: %s: form singular label */ |
255 | - 'delete_payment_download' => sprintf( esc_html( 'Are you sure you wish to delete this %s?', 'give' ), give_get_forms_label_singular() ), |
|
256 | - 'one_price_min' => esc_html( 'You must have at least one price.', 'give' ), |
|
257 | - 'one_file_min' => esc_html( 'You must have at least one file.', 'give' ), |
|
258 | - 'one_field_min' => esc_html( 'You must have at least one field.', 'give' ), |
|
255 | + 'delete_payment_download' => sprintf(esc_html('Are you sure you wish to delete this %s?', 'give'), give_get_forms_label_singular()), |
|
256 | + 'one_price_min' => esc_html('You must have at least one price.', 'give'), |
|
257 | + 'one_file_min' => esc_html('You must have at least one file.', 'give'), |
|
258 | + 'one_field_min' => esc_html('You must have at least one field.', 'give'), |
|
259 | 259 | /* translators: %s: form singular label */ |
260 | - 'one_option' => sprintf( esc_html( 'Choose a %s', 'give' ), give_get_forms_label_singular() ), |
|
260 | + 'one_option' => sprintf(esc_html('Choose a %s', 'give'), give_get_forms_label_singular()), |
|
261 | 261 | /* translators: %s: form plural label */ |
262 | - 'one_or_more_option' => sprintf( esc_html( 'Choose one or more %s', 'give' ), give_get_forms_label_plural() ), |
|
263 | - 'numeric_item_price' => esc_html( 'Item price must be numeric.', 'give' ), |
|
264 | - 'numeric_quantity' => esc_html( 'Quantity must be numeric.', 'give' ), |
|
265 | - 'currency_sign' => give_currency_filter( '' ), |
|
266 | - 'currency_pos' => isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before', |
|
262 | + 'one_or_more_option' => sprintf(esc_html('Choose one or more %s', 'give'), give_get_forms_label_plural()), |
|
263 | + 'numeric_item_price' => esc_html('Item price must be numeric.', 'give'), |
|
264 | + 'numeric_quantity' => esc_html('Quantity must be numeric.', 'give'), |
|
265 | + 'currency_sign' => give_currency_filter(''), |
|
266 | + 'currency_pos' => isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before', |
|
267 | 267 | 'currency_decimals' => give_currency_decimal_filter(), |
268 | - 'new_media_ui' => apply_filters( 'give_use_35_media_ui', 1 ), |
|
269 | - 'remove_text' => esc_html( 'Remove', 'give' ), |
|
268 | + 'new_media_ui' => apply_filters('give_use_35_media_ui', 1), |
|
269 | + 'remove_text' => esc_html('Remove', 'give'), |
|
270 | 270 | /* translators: %s: form plural label */ |
271 | - 'type_to_search' => sprintf( esc_html( 'Type to search %s', 'give' ), give_get_forms_label_plural() ), |
|
272 | - 'batch_export_no_class' => esc_html( 'You must choose a method.', 'give' ), |
|
273 | - 'batch_export_no_reqs' => esc_html( 'Required fields not completed.', 'give' ), |
|
274 | - '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' ), |
|
275 | - ) ); |
|
271 | + 'type_to_search' => sprintf(esc_html('Type to search %s', 'give'), give_get_forms_label_plural()), |
|
272 | + 'batch_export_no_class' => esc_html('You must choose a method.', 'give'), |
|
273 | + 'batch_export_no_reqs' => esc_html('Required fields not completed.', 'give'), |
|
274 | + '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'), |
|
275 | + )); |
|
276 | 276 | |
277 | - if ( function_exists( 'wp_enqueue_media' ) && version_compare( $wp_version, '3.5', '>=' ) ) { |
|
277 | + if (function_exists('wp_enqueue_media') && version_compare($wp_version, '3.5', '>=')) { |
|
278 | 278 | //call for new media manager |
279 | 279 | wp_enqueue_media(); |
280 | 280 | } |
281 | 281 | |
282 | 282 | } |
283 | 283 | |
284 | -add_action( 'admin_enqueue_scripts', 'give_load_admin_scripts', 100 ); |
|
284 | +add_action('admin_enqueue_scripts', 'give_load_admin_scripts', 100); |
|
285 | 285 | |
286 | 286 | /** |
287 | 287 | * Admin Give Icon |
@@ -298,14 +298,14 @@ discard block |
||
298 | 298 | ?> |
299 | 299 | <style type="text/css" media="screen"> |
300 | 300 | |
301 | - <?php if( version_compare( $wp_version, '3.8-RC', '>=' ) || version_compare( $wp_version, '3.8', '>=' ) ) { ?> |
|
301 | + <?php if (version_compare($wp_version, '3.8-RC', '>=') || version_compare($wp_version, '3.8', '>=')) { ?> |
|
302 | 302 | @font-face { |
303 | 303 | font-family: 'give-icomoon'; |
304 | - src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?-ngjl88'; ?>'); |
|
305 | - src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?#iefix-ngjl88'?>') format('embedded-opentype'), |
|
306 | - url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.woff?-ngjl88'; ?>') format('woff'), |
|
307 | - url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.ttf?-ngjl88'; ?>') format('truetype'), |
|
308 | - url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.svg?-ngjl88#icomoon'; ?>') format('svg'); |
|
304 | + src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?-ngjl88'; ?>'); |
|
305 | + src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?#iefix-ngjl88'?>') format('embedded-opentype'), |
|
306 | + url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.woff?-ngjl88'; ?>') format('woff'), |
|
307 | + url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.ttf?-ngjl88'; ?>') format('truetype'), |
|
308 | + url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.svg?-ngjl88#icomoon'; ?>') format('svg'); |
|
309 | 309 | font-weight: normal; |
310 | 310 | font-style: normal; |
311 | 311 | } |
@@ -324,4 +324,4 @@ discard block |
||
324 | 324 | <?php |
325 | 325 | } |
326 | 326 | |
327 | -add_action( 'admin_head', 'give_admin_icon' ); |
|
327 | +add_action('admin_head', 'give_admin_icon'); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly |
14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
14 | +if ( ! defined('ABSPATH')) { |
|
15 | 15 | exit; |
16 | 16 | } |
17 | 17 | |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | * @since 1.0 |
36 | 36 | */ |
37 | 37 | public function __construct() { |
38 | - add_action( 'admin_menu', array( $this, 'admin_menus' ) ); |
|
39 | - add_action( 'admin_head', array( $this, 'admin_head' ) ); |
|
40 | - add_action( 'admin_init', array( $this, 'welcome' ) ); |
|
38 | + add_action('admin_menu', array($this, 'admin_menus')); |
|
39 | + add_action('admin_head', array($this, 'admin_head')); |
|
40 | + add_action('admin_init', array($this, 'welcome')); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -51,38 +51,38 @@ discard block |
||
51 | 51 | public function admin_menus() { |
52 | 52 | // About Page |
53 | 53 | add_dashboard_page( |
54 | - esc_html( 'Welcome to Give', 'give' ), |
|
55 | - esc_html( 'Welcome to Give', 'give' ), |
|
54 | + esc_html('Welcome to Give', 'give'), |
|
55 | + esc_html('Welcome to Give', 'give'), |
|
56 | 56 | $this->minimum_capability, |
57 | 57 | 'give-about', |
58 | - array( $this, 'about_screen' ) |
|
58 | + array($this, 'about_screen') |
|
59 | 59 | ); |
60 | 60 | |
61 | 61 | // Changelog Page |
62 | 62 | add_dashboard_page( |
63 | - esc_html( 'Give Changelog', 'give' ), |
|
64 | - esc_html( 'Give Changelog', 'give' ), |
|
63 | + esc_html('Give Changelog', 'give'), |
|
64 | + esc_html('Give Changelog', 'give'), |
|
65 | 65 | $this->minimum_capability, |
66 | 66 | 'give-changelog', |
67 | - array( $this, 'changelog_screen' ) |
|
67 | + array($this, 'changelog_screen') |
|
68 | 68 | ); |
69 | 69 | |
70 | 70 | // Getting Started Page |
71 | 71 | add_dashboard_page( |
72 | - esc_html( 'Getting started with Give', 'give' ), |
|
73 | - esc_html( 'Getting started with Give', 'give' ), |
|
72 | + esc_html('Getting started with Give', 'give'), |
|
73 | + esc_html('Getting started with Give', 'give'), |
|
74 | 74 | $this->minimum_capability, |
75 | 75 | 'give-getting-started', |
76 | - array( $this, 'getting_started_screen' ) |
|
76 | + array($this, 'getting_started_screen') |
|
77 | 77 | ); |
78 | 78 | |
79 | 79 | // Credits Page |
80 | 80 | add_dashboard_page( |
81 | - esc_html( 'The people that build Give', 'give' ), |
|
82 | - esc_html( 'The people that build Give', 'give' ), |
|
81 | + esc_html('The people that build Give', 'give'), |
|
82 | + esc_html('The people that build Give', 'give'), |
|
83 | 83 | $this->minimum_capability, |
84 | 84 | 'give-credits', |
85 | - array( $this, 'credits_screen' ) |
|
85 | + array($this, 'credits_screen') |
|
86 | 86 | ); |
87 | 87 | } |
88 | 88 | |
@@ -95,13 +95,13 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function admin_head() { |
97 | 97 | |
98 | - remove_submenu_page( 'index.php', 'give-about' ); |
|
99 | - remove_submenu_page( 'index.php', 'give-changelog' ); |
|
100 | - remove_submenu_page( 'index.php', 'give-getting-started' ); |
|
101 | - remove_submenu_page( 'index.php', 'give-credits' ); |
|
98 | + remove_submenu_page('index.php', 'give-about'); |
|
99 | + remove_submenu_page('index.php', 'give-changelog'); |
|
100 | + remove_submenu_page('index.php', 'give-getting-started'); |
|
101 | + remove_submenu_page('index.php', 'give-credits'); |
|
102 | 102 | |
103 | 103 | // Badge for welcome page |
104 | - $badge_url = GIVE_PLUGIN_URL . 'assets/images/give-badge.png'; |
|
104 | + $badge_url = GIVE_PLUGIN_URL.'assets/images/give-badge.png'; |
|
105 | 105 | |
106 | 106 | ?> |
107 | 107 | <style type="text/css" media="screen"> |
@@ -215,20 +215,20 @@ discard block |
||
215 | 215 | * @return void |
216 | 216 | */ |
217 | 217 | public function tabs() { |
218 | - $selected = isset( $_GET['page'] ) ? $_GET['page'] : 'give-about'; |
|
218 | + $selected = isset($_GET['page']) ? $_GET['page'] : 'give-about'; |
|
219 | 219 | ?> |
220 | 220 | <h1 class="nav-tab-wrapper"> |
221 | - <a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-about' ), 'index.php' ) ) ); ?>"> |
|
222 | - <?php esc_html_e( "About Give", 'give' ); ?> |
|
221 | + <a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-about'), 'index.php'))); ?>"> |
|
222 | + <?php esc_html_e("About Give", 'give'); ?> |
|
223 | 223 | </a> |
224 | - <a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-getting-started' ), 'index.php' ) ) ); ?>"> |
|
225 | - <?php esc_html_e( 'Getting Started', 'give' ); ?> |
|
224 | + <a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-getting-started'), 'index.php'))); ?>"> |
|
225 | + <?php esc_html_e('Getting Started', 'give'); ?> |
|
226 | 226 | </a> |
227 | - <a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-credits' ), 'index.php' ) ) ); ?>"> |
|
228 | - <?php esc_html_e( 'Credits', 'give' ); ?> |
|
227 | + <a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-credits'), 'index.php'))); ?>"> |
|
228 | + <?php esc_html_e('Credits', 'give'); ?> |
|
229 | 229 | </a> |
230 | - <a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( null, 'index.php' ) ) . 'edit.php?post_type=give_forms&page=give-addons'; ?>"> |
|
231 | - <?php esc_html_e( 'Add-ons', 'give' ); ?> |
|
230 | + <a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(null, 'index.php')).'edit.php?post_type=give_forms&page=give-addons'; ?>"> |
|
231 | + <?php esc_html_e('Add-ons', 'give'); ?> |
|
232 | 232 | </a> |
233 | 233 | </h1> |
234 | 234 | <?php |
@@ -242,13 +242,13 @@ discard block |
||
242 | 242 | * @return void |
243 | 243 | */ |
244 | 244 | public function about_screen() { |
245 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
245 | + list($display_version) = explode('-', GIVE_VERSION); |
|
246 | 246 | ?> |
247 | 247 | <div class="wrap about-wrap"> |
248 | 248 | <h1 class="welcome-h1"><?php |
249 | 249 | printf( |
250 | 250 | /* translators: %s: Give version */ |
251 | - esc_html( 'Welcome to Give %s', 'give' ), |
|
251 | + esc_html('Welcome to Give %s', 'give'), |
|
252 | 252 | $display_version |
253 | 253 | ); |
254 | 254 | ?></h1> |
@@ -258,20 +258,20 @@ discard block |
||
258 | 258 | <div class="about-text"><?php |
259 | 259 | printf( |
260 | 260 | /* translators: 1: https://givewp.com/documenation/ 2: title attribute text */ |
261 | - __( 'Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. </You>We encourage you to check out the <a href="%1$s" title="%2$s" target="_blank">plugin documentation</a> and getting started guide below.', 'give' ), |
|
262 | - esc_url( 'https://givewp.com/documenation/' ), |
|
263 | - esc_attr( 'View the Give plugin documentation online', 'give' ) |
|
261 | + __('Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. </You>We encourage you to check out the <a href="%1$s" title="%2$s" target="_blank">plugin documentation</a> and getting started guide below.', 'give'), |
|
262 | + esc_url('https://givewp.com/documenation/'), |
|
263 | + esc_attr('View the Give plugin documentation online', 'give') |
|
264 | 264 | ); |
265 | 265 | ?></div> |
266 | 266 | |
267 | - <p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p> |
|
267 | + <p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p> |
|
268 | 268 | |
269 | 269 | <?php give_get_newsletter() ?> |
270 | 270 | |
271 | 271 | <div class="give-badge"><?php |
272 | 272 | printf( |
273 | 273 | /* translators: %s: Give version */ |
274 | - esc_html( 'Version %s', 'give' ), |
|
274 | + esc_html('Version %s', 'give'), |
|
275 | 275 | $display_version |
276 | 276 | ); |
277 | 277 | ?></div> |
@@ -283,15 +283,15 @@ discard block |
||
283 | 283 | <div class="feature-section clearfix introduction"> |
284 | 284 | |
285 | 285 | <div class="video feature-section-item"> |
286 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-form-mockup.png' ?>" title="A Give donation form" alt="A Give donation form"> |
|
286 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-form-mockup.png' ?>" title="A Give donation form" alt="A Give donation form"> |
|
287 | 287 | |
288 | 288 | </div> |
289 | 289 | |
290 | 290 | <div class="content feature-section-item last-feature"> |
291 | 291 | |
292 | - <h3><?php esc_html_e( 'Give - Democratizing Generosity', 'give' ); ?></h3> |
|
292 | + <h3><?php esc_html_e('Give - Democratizing Generosity', 'give'); ?></h3> |
|
293 | 293 | |
294 | - <p><?php esc_html_e( 'Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give' ); ?></p> |
|
294 | + <p><?php esc_html_e('Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give'); ?></p> |
|
295 | 295 | <a href="https://givewp.com" target="_blank" class="button-secondary" title="Visit the Give Website">Learn More |
296 | 296 | <span class="dashicons dashicons-external"></span></a> |
297 | 297 | |
@@ -304,9 +304,9 @@ discard block |
||
304 | 304 | |
305 | 305 | <div class="content feature-section-item"> |
306 | 306 | |
307 | - <h3><?php esc_html_e( 'Getting to Know Give', 'give' ); ?></h3> |
|
307 | + <h3><?php esc_html_e('Getting to Know Give', 'give'); ?></h3> |
|
308 | 308 | |
309 | - <p><?php esc_html_e( 'Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give' ); ?></p> |
|
309 | + <p><?php esc_html_e('Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give'); ?></p> |
|
310 | 310 | <a href="https://givewp.com/documentation" target="_blank" class="button-secondary" title="Visit the Give Website">View Documentation |
311 | 311 | <span class="dashicons dashicons-external"></span></a> |
312 | 312 | |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | |
315 | 315 | <div class="content feature-section-item last-feature"> |
316 | 316 | |
317 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-logo-photo-mashup.png' ?>" title="Give" alt="Give"> |
|
317 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-logo-photo-mashup.png' ?>" title="Give" alt="Give"> |
|
318 | 318 | |
319 | 319 | </div> |
320 | 320 | |
@@ -334,22 +334,22 @@ discard block |
||
334 | 334 | * @return void |
335 | 335 | */ |
336 | 336 | public function changelog_screen() { |
337 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
337 | + list($display_version) = explode('-', GIVE_VERSION); |
|
338 | 338 | ?> |
339 | 339 | <div class="wrap about-wrap"> |
340 | - <h1><?php esc_html_e( 'Give Changelog', 'give' ); ?></h1> |
|
340 | + <h1><?php esc_html_e('Give Changelog', 'give'); ?></h1> |
|
341 | 341 | |
342 | 342 | <div class="about-text"><?php |
343 | 343 | printf( |
344 | 344 | /* translators: %s: Give version */ |
345 | - esc_html( 'Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give' ), |
|
345 | + esc_html('Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give'), |
|
346 | 346 | $display_version |
347 | 347 | ); |
348 | 348 | ?></div> |
349 | 349 | <div class="give-badge"><?php |
350 | 350 | printf( |
351 | 351 | /* translators: %s: Give version */ |
352 | - esc_html( 'Version %s', 'give' ), |
|
352 | + esc_html('Version %s', 'give'), |
|
353 | 353 | $display_version |
354 | 354 | ); |
355 | 355 | ?></div> |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | <?php $this->tabs(); ?> |
358 | 358 | |
359 | 359 | <div class="changelog"> |
360 | - <h3><?php esc_html_e( 'Full Changelog', 'give' ); ?></h3> |
|
360 | + <h3><?php esc_html_e('Full Changelog', 'give'); ?></h3> |
|
361 | 361 | |
362 | 362 | <div class="feature-section"> |
363 | 363 | <?php echo $this->parse_readme(); ?> |
@@ -365,10 +365,10 @@ discard block |
||
365 | 365 | </div> |
366 | 366 | |
367 | 367 | <div class="return-to-dashboard"> |
368 | - <a href="<?php echo esc_url( admin_url( add_query_arg( array( |
|
368 | + <a href="<?php echo esc_url(admin_url(add_query_arg(array( |
|
369 | 369 | 'post_type' => 'give_forms', |
370 | 370 | 'page' => 'give-settings' |
371 | - ), 'edit.php' ) ) ); ?>"><?php esc_html_e( 'Go to Give Settings', 'give' ); ?></a> |
|
371 | + ), 'edit.php'))); ?>"><?php esc_html_e('Go to Give Settings', 'give'); ?></a> |
|
372 | 372 | </div> |
373 | 373 | </div> |
374 | 374 | <?php |
@@ -382,29 +382,29 @@ discard block |
||
382 | 382 | * @return void |
383 | 383 | */ |
384 | 384 | public function getting_started_screen() { |
385 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
385 | + list($display_version) = explode('-', GIVE_VERSION); |
|
386 | 386 | ?> |
387 | 387 | <div class="wrap about-wrap get-started"> |
388 | 388 | <h1 class="welcome-h1"><?php |
389 | 389 | printf( |
390 | 390 | /* translators: %s: Give version */ |
391 | - esc_html( 'Give %s - Getting Started Guide', 'give' ), |
|
391 | + esc_html('Give %s - Getting Started Guide', 'give'), |
|
392 | 392 | $display_version |
393 | 393 | ); |
394 | 394 | ?></h1> |
395 | 395 | |
396 | 396 | <?php give_social_media_elements() ?> |
397 | 397 | |
398 | - <div class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></div> |
|
398 | + <div class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></div> |
|
399 | 399 | |
400 | - <p class="newsletter-intro"><?php esc_html_e( 'Don\'t forget to sign up for the newsletter!', 'give' ); ?>.</p> |
|
400 | + <p class="newsletter-intro"><?php esc_html_e('Don\'t forget to sign up for the newsletter!', 'give'); ?>.</p> |
|
401 | 401 | |
402 | 402 | <?php give_get_newsletter() ?> |
403 | 403 | |
404 | 404 | <div class="give-badge"><?php |
405 | 405 | printf( |
406 | 406 | /* translators: %s: Give version */ |
407 | - esc_html( 'Version %s', 'give' ), |
|
407 | + esc_html('Version %s', 'give'), |
|
408 | 408 | $display_version |
409 | 409 | ); |
410 | 410 | ?></div> |
@@ -412,17 +412,17 @@ discard block |
||
412 | 412 | <?php $this->tabs(); ?> |
413 | 413 | |
414 | 414 | |
415 | - <div class="about-text"><?php printf( esc_html( 'Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give' ), $display_version ); ?></div> |
|
415 | + <div class="about-text"><?php printf(esc_html('Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give'), $display_version); ?></div> |
|
416 | 416 | |
417 | 417 | |
418 | 418 | <div class="feature-section clearfix"> |
419 | 419 | |
420 | 420 | <div class="content feature-section-item"> |
421 | - <h3><?php esc_html_e( 'STEP 1: Create a New Form', 'give' ); ?></h3> |
|
421 | + <h3><?php esc_html_e('STEP 1: Create a New Form', 'give'); ?></h3> |
|
422 | 422 | |
423 | - <p><?php esc_html_e( 'Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give' ); ?></p> |
|
423 | + <p><?php esc_html_e('Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give'); ?></p> |
|
424 | 424 | |
425 | - <p><?php esc_html_e( 'But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give' ); ?></p> |
|
425 | + <p><?php esc_html_e('But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give'); ?></p> |
|
426 | 426 | </div> |
427 | 427 | |
428 | 428 | <div class="content feature-section-item last-feature"> |
@@ -439,9 +439,9 @@ discard block |
||
439 | 439 | </div> |
440 | 440 | |
441 | 441 | <div class="content feature-section-item last-feature"> |
442 | - <h3><?php esc_html_e( 'STEP 2: Choose Your Levels', 'give' ); ?></h3> |
|
442 | + <h3><?php esc_html_e('STEP 2: Choose Your Levels', 'give'); ?></h3> |
|
443 | 443 | |
444 | - <p><?php esc_html_e( 'Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give' ); ?></p> |
|
444 | + <p><?php esc_html_e('Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give'); ?></p> |
|
445 | 445 | </div> |
446 | 446 | |
447 | 447 | </div> |
@@ -450,11 +450,11 @@ discard block |
||
450 | 450 | <div class="feature-section clearfix"> |
451 | 451 | |
452 | 452 | <div class="content feature-section-item add-content"> |
453 | - <h3><?php esc_html_e( 'STEP 3: Landing Page or Shortcode Mode?', 'give' ); ?></h3> |
|
453 | + <h3><?php esc_html_e('STEP 3: Landing Page or Shortcode Mode?', 'give'); ?></h3> |
|
454 | 454 | |
455 | - <p><?php esc_html_e( 'Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give' ); ?></p> |
|
455 | + <p><?php esc_html_e('Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give'); ?></p> |
|
456 | 456 | |
457 | - <p><?php esc_html_e( 'You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the Donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give' ); ?></p> |
|
457 | + <p><?php esc_html_e('You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the Donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give'); ?></p> |
|
458 | 458 | </div> |
459 | 459 | |
460 | 460 | <div class="content feature-section-item last-feature"> |
@@ -471,9 +471,9 @@ discard block |
||
471 | 471 | </div> |
472 | 472 | |
473 | 473 | <div class="content feature-section-item last-feature"> |
474 | - <h3><?php esc_html_e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3> |
|
474 | + <h3><?php esc_html_e('STEP 4: Configure Your Display Options', 'give'); ?></h3> |
|
475 | 475 | |
476 | - <p><?php esc_html_e( 'Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give' ); ?></p> |
|
476 | + <p><?php esc_html_e('Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give'); ?></p> |
|
477 | 477 | </div> |
478 | 478 | |
479 | 479 | |
@@ -493,38 +493,38 @@ discard block |
||
493 | 493 | * @return void |
494 | 494 | */ |
495 | 495 | public function credits_screen() { |
496 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
496 | + list($display_version) = explode('-', GIVE_VERSION); |
|
497 | 497 | ?> |
498 | 498 | <div class="wrap about-wrap"> |
499 | 499 | <h1 class="welcome-h1"><?php |
500 | 500 | printf( |
501 | 501 | /* translators: %s: Give version */ |
502 | - esc_html( 'Give %s - Credits', 'give' ), |
|
502 | + esc_html('Give %s - Credits', 'give'), |
|
503 | 503 | $display_version |
504 | 504 | ); |
505 | 505 | ?></h1> |
506 | 506 | |
507 | 507 | <?php give_social_media_elements() ?> |
508 | 508 | |
509 | - <div class="about-text"><?php esc_html_e( 'Thanks to all those who have contributed code directly or indirectly. ', 'give' ); ?></div> |
|
509 | + <div class="about-text"><?php esc_html_e('Thanks to all those who have contributed code directly or indirectly. ', 'give'); ?></div> |
|
510 | 510 | |
511 | - <div class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></div> |
|
511 | + <div class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></div> |
|
512 | 512 | |
513 | - <p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p> |
|
513 | + <p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p> |
|
514 | 514 | |
515 | 515 | <?php give_get_newsletter() ?> |
516 | 516 | |
517 | 517 | <div class="give-badge"><?php |
518 | 518 | printf( |
519 | 519 | /* translators: %s: Give version */ |
520 | - esc_html( 'Version %s', 'give' ), |
|
520 | + esc_html('Version %s', 'give'), |
|
521 | 521 | $display_version |
522 | 522 | ); |
523 | 523 | ?></div> |
524 | 524 | |
525 | 525 | <?php $this->tabs(); ?> |
526 | 526 | |
527 | - <p class="about-description"><?php printf( __( 'Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give' ), esc_url( 'https://github.com/WordImpress/give' ) ); ?></p> |
|
527 | + <p class="about-description"><?php printf(__('Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give'), esc_url('https://github.com/WordImpress/give')); ?></p> |
|
528 | 528 | |
529 | 529 | <?php echo $this->contributors(); ?> |
530 | 530 | </div> |
@@ -539,21 +539,21 @@ discard block |
||
539 | 539 | * @return string $readme HTML formatted readme file |
540 | 540 | */ |
541 | 541 | public function parse_readme() { |
542 | - $file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null; |
|
542 | + $file = file_exists(GIVE_PLUGIN_DIR.'readme.txt') ? GIVE_PLUGIN_DIR.'readme.txt' : null; |
|
543 | 543 | |
544 | - if ( ! $file ) { |
|
545 | - $readme = '<p>' . esc_html( 'No valid changlog was found.', 'give' ) . '</p>'; |
|
544 | + if ( ! $file) { |
|
545 | + $readme = '<p>'.esc_html('No valid changlog was found.', 'give').'</p>'; |
|
546 | 546 | } else { |
547 | - $readme = file_get_contents( $file ); |
|
548 | - $readme = nl2br( esc_html( $readme ) ); |
|
549 | - $readme = explode( '== Changelog ==', $readme ); |
|
550 | - $readme = end( $readme ); |
|
551 | - |
|
552 | - $readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme ); |
|
553 | - $readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme ); |
|
554 | - $readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme ); |
|
555 | - $readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme ); |
|
556 | - $readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme ); |
|
547 | + $readme = file_get_contents($file); |
|
548 | + $readme = nl2br(esc_html($readme)); |
|
549 | + $readme = explode('== Changelog ==', $readme); |
|
550 | + $readme = end($readme); |
|
551 | + |
|
552 | + $readme = preg_replace('/`(.*?)`/', '<code>\\1</code>', $readme); |
|
553 | + $readme = preg_replace('/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme); |
|
554 | + $readme = preg_replace('/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme); |
|
555 | + $readme = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $readme); |
|
556 | + $readme = preg_replace('/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme); |
|
557 | 557 | } |
558 | 558 | |
559 | 559 | return $readme; |
@@ -570,27 +570,27 @@ discard block |
||
570 | 570 | public function contributors() { |
571 | 571 | $contributors = $this->get_contributors(); |
572 | 572 | |
573 | - if ( empty( $contributors ) ) { |
|
573 | + if (empty($contributors)) { |
|
574 | 574 | return ''; |
575 | 575 | } |
576 | 576 | |
577 | 577 | $contributor_list = '<ul class="wp-people-group">'; |
578 | 578 | |
579 | - foreach ( $contributors as $contributor ) { |
|
579 | + foreach ($contributors as $contributor) { |
|
580 | 580 | $contributor_list .= '<li class="wp-person">'; |
581 | - $contributor_list .= sprintf( '<a href="%s" title="%s">', |
|
582 | - esc_url( 'https://github.com/' . $contributor->login ), |
|
581 | + $contributor_list .= sprintf('<a href="%s" title="%s">', |
|
582 | + esc_url('https://github.com/'.$contributor->login), |
|
583 | 583 | esc_html( |
584 | 584 | sprintf( |
585 | 585 | /* translators: %s: github contributor */ |
586 | - esc_html( 'View %s', 'give' ), |
|
586 | + esc_html('View %s', 'give'), |
|
587 | 587 | $contributor->login |
588 | 588 | ) |
589 | 589 | ) |
590 | 590 | ); |
591 | - $contributor_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $contributor->avatar_url ), esc_html( $contributor->login ) ); |
|
591 | + $contributor_list .= sprintf('<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url($contributor->avatar_url), esc_html($contributor->login)); |
|
592 | 592 | $contributor_list .= '</a>'; |
593 | - $contributor_list .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html( $contributor->login ) ); |
|
593 | + $contributor_list .= sprintf('<a class="web" href="%s">%s</a>', esc_url('https://github.com/'.$contributor->login), esc_html($contributor->login)); |
|
594 | 594 | $contributor_list .= '</a>'; |
595 | 595 | $contributor_list .= '</li>'; |
596 | 596 | } |
@@ -608,25 +608,25 @@ discard block |
||
608 | 608 | * @return array $contributors List of contributors |
609 | 609 | */ |
610 | 610 | public function get_contributors() { |
611 | - $contributors = get_transient( 'give_contributors' ); |
|
611 | + $contributors = get_transient('give_contributors'); |
|
612 | 612 | |
613 | - if ( false !== $contributors ) { |
|
613 | + if (false !== $contributors) { |
|
614 | 614 | return $contributors; |
615 | 615 | } |
616 | 616 | |
617 | - $response = wp_remote_get( 'https://api.github.com/repos/WordImpress/Give/contributors', array( 'sslverify' => false ) ); |
|
617 | + $response = wp_remote_get('https://api.github.com/repos/WordImpress/Give/contributors', array('sslverify' => false)); |
|
618 | 618 | |
619 | - if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) { |
|
619 | + if (is_wp_error($response) || 200 != wp_remote_retrieve_response_code($response)) { |
|
620 | 620 | return array(); |
621 | 621 | } |
622 | 622 | |
623 | - $contributors = json_decode( wp_remote_retrieve_body( $response ) ); |
|
623 | + $contributors = json_decode(wp_remote_retrieve_body($response)); |
|
624 | 624 | |
625 | - if ( ! is_array( $contributors ) ) { |
|
625 | + if ( ! is_array($contributors)) { |
|
626 | 626 | return array(); |
627 | 627 | } |
628 | 628 | |
629 | - set_transient( 'give_contributors', $contributors, 3600 ); |
|
629 | + set_transient('give_contributors', $contributors, 3600); |
|
630 | 630 | |
631 | 631 | return $contributors; |
632 | 632 | } |
@@ -645,24 +645,24 @@ discard block |
||
645 | 645 | |
646 | 646 | |
647 | 647 | // Bail if no activation redirect |
648 | - if ( ! get_transient( '_give_activation_redirect' ) ) { |
|
648 | + if ( ! get_transient('_give_activation_redirect')) { |
|
649 | 649 | return; |
650 | 650 | } |
651 | 651 | |
652 | 652 | // Delete the redirect transient |
653 | - delete_transient( '_give_activation_redirect' ); |
|
653 | + delete_transient('_give_activation_redirect'); |
|
654 | 654 | |
655 | 655 | // Bail if activating from network, or bulk |
656 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
|
656 | + if (is_network_admin() || isset($_GET['activate-multi'])) { |
|
657 | 657 | return; |
658 | 658 | } |
659 | 659 | |
660 | - $upgrade = get_option( 'give_version_upgraded_from' ); |
|
660 | + $upgrade = get_option('give_version_upgraded_from'); |
|
661 | 661 | |
662 | - if ( ! $upgrade ) { // First time install |
|
663 | - wp_safe_redirect( admin_url( 'index.php?page=give-about' ) ); |
|
662 | + if ( ! $upgrade) { // First time install |
|
663 | + wp_safe_redirect(admin_url('index.php?page=give-about')); |
|
664 | 664 | exit; |
665 | - } elseif( isset( $give_options['disable_welcome'] ) ) { // Welcome is disabled in settings |
|
665 | + } elseif (isset($give_options['disable_welcome'])) { // Welcome is disabled in settings |
|
666 | 666 | |
667 | 667 | } else { // Welcome is NOT disabled in settings |
668 | 668 | wp_safe_redirect(admin_url('index.php?page=give-about')); |
@@ -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 | |
@@ -22,80 +22,80 @@ discard block |
||
22 | 22 | */ |
23 | 23 | function give_tools_recount_stats_display() { |
24 | 24 | |
25 | - if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
25 | + if ( ! current_user_can('manage_give_settings')) { |
|
26 | 26 | return; |
27 | 27 | } |
28 | 28 | |
29 | - do_action( 'give_tools_recount_stats_before' ); |
|
29 | + do_action('give_tools_recount_stats_before'); |
|
30 | 30 | ?> |
31 | 31 | <div id="poststuff"> |
32 | 32 | <div class="postbox"> |
33 | 33 | |
34 | - <h2 class="hndle ui-sortable-handle"><span><?php esc_html_e( 'Recount Stats', 'give' ); ?></span></h2> |
|
34 | + <h2 class="hndle ui-sortable-handle"><span><?php esc_html_e('Recount Stats', 'give'); ?></span></h2> |
|
35 | 35 | |
36 | 36 | <div class="inside recount-stats-controls"> |
37 | - <p><?php esc_html_e( 'Use these tools to recount stats, delete test transactions, or reset stats.', 'give' ); ?></p> |
|
37 | + <p><?php esc_html_e('Use these tools to recount stats, delete test transactions, or reset stats.', 'give'); ?></p> |
|
38 | 38 | <form method="post" id="give-tools-recount-form" class="give-export-form"> |
39 | 39 | |
40 | - <?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?> |
|
40 | + <?php wp_nonce_field('give_ajax_export', 'give_ajax_export'); ?> |
|
41 | 41 | |
42 | 42 | <select name="give-export-class" id="recount-stats-type"> |
43 | - <option value="0" selected="selected" disabled="disabled"><?php esc_html_e( 'Please select an option', 'give' ); ?></option> |
|
44 | - <option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php esc_html_e( 'Recalculate Total Donation Income Amount', 'give' ); ?></option> |
|
45 | - <option data-type="recount-form" value="Give_Tools_Recount_Form_Stats"><?php esc_html_e( 'Recalculate Income Amount and Donation Counts for a Form', 'give' ); ?></option> |
|
46 | - <option data-type="recount-all" value="Give_Tools_Recount_All_Stats"><?php esc_html_e( 'Recalculate Income Amount and Donation Counts for All Forms', 'give' ); ?></option> |
|
47 | - <option data-type="recount-customer-stats" value="Give_Tools_Recount_Customer_Stats"><?php esc_html_e( 'Recalculate Donor Statistics', 'give' ); ?></option> |
|
48 | - <option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php esc_html_e( 'Delete Test Transactions', 'give' ); ?></option> |
|
49 | - <option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php esc_html_e( 'Delete All Data', 'give' ); ?></option> |
|
50 | - <?php do_action( 'give_recount_tool_options' ); ?> |
|
43 | + <option value="0" selected="selected" disabled="disabled"><?php esc_html_e('Please select an option', 'give'); ?></option> |
|
44 | + <option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php esc_html_e('Recalculate Total Donation Income Amount', 'give'); ?></option> |
|
45 | + <option data-type="recount-form" value="Give_Tools_Recount_Form_Stats"><?php esc_html_e('Recalculate Income Amount and Donation Counts for a Form', 'give'); ?></option> |
|
46 | + <option data-type="recount-all" value="Give_Tools_Recount_All_Stats"><?php esc_html_e('Recalculate Income Amount and Donation Counts for All Forms', 'give'); ?></option> |
|
47 | + <option data-type="recount-customer-stats" value="Give_Tools_Recount_Customer_Stats"><?php esc_html_e('Recalculate Donor Statistics', 'give'); ?></option> |
|
48 | + <option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php esc_html_e('Delete Test Transactions', 'give'); ?></option> |
|
49 | + <option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php esc_html_e('Delete All Data', 'give'); ?></option> |
|
50 | + <?php do_action('give_recount_tool_options'); ?> |
|
51 | 51 | </select> |
52 | 52 | |
53 | 53 | <span id="tools-form-dropdown" style="display: none"> |
54 | 54 | <?php |
55 | 55 | $args = array( |
56 | 56 | 'name' => 'form_id', |
57 | - 'number' => - 1, |
|
57 | + 'number' => -1, |
|
58 | 58 | 'chosen' => true, |
59 | 59 | ); |
60 | - echo Give()->html->forms_dropdown( $args ); |
|
60 | + echo Give()->html->forms_dropdown($args); |
|
61 | 61 | ?> |
62 | 62 | </span> |
63 | 63 | |
64 | - <input type="submit" id="recount-stats-submit" value="<?php esc_attr_e( 'Submit', 'give' ); ?>" class="button-secondary"/> |
|
64 | + <input type="submit" id="recount-stats-submit" value="<?php esc_attr_e('Submit', 'give'); ?>" class="button-secondary"/> |
|
65 | 65 | |
66 | 66 | <br/> |
67 | 67 | |
68 | 68 | <span class="give-recount-stats-descriptions"> |
69 | - <span id="recount-stats"><?php esc_html_e( 'Recalculates the overall donation income amount.', 'give' ); ?></span> |
|
69 | + <span id="recount-stats"><?php esc_html_e('Recalculates the overall donation income amount.', 'give'); ?></span> |
|
70 | 70 | <span id="recount-form"><?php |
71 | 71 | printf( |
72 | 72 | /* translators: %s: form singular label */ |
73 | - esc_html( 'Recalculates the donation and income stats for a specific %s.', 'give' ), |
|
74 | - give_get_forms_label_singular( true ) |
|
73 | + esc_html('Recalculates the donation and income stats for a specific %s.', 'give'), |
|
74 | + give_get_forms_label_singular(true) |
|
75 | 75 | ); |
76 | 76 | ?></span> |
77 | 77 | <span id="recount-all"><?php |
78 | 78 | printf( |
79 | 79 | /* translators: %s: form plural label */ |
80 | - esc_html( 'Recalculates the earnings and sales stats for all %s.', 'give' ), |
|
81 | - give_get_forms_label_plural( true ) |
|
80 | + esc_html('Recalculates the earnings and sales stats for all %s.', 'give'), |
|
81 | + give_get_forms_label_plural(true) |
|
82 | 82 | ); |
83 | 83 | ?></span> |
84 | - <span id="recount-customer-stats"><?php esc_html_e( 'Recalculates the lifetime value and donation counts for all donors.', 'give' ); ?></span> |
|
85 | - <?php do_action( 'give_recount_tool_descriptions' ); ?> |
|
86 | - <span id="delete-test-transactions"><?php _e( '<strong>Deletes</strong> all TEST payment records, donors, and related log entries.', 'give' ); ?></span> |
|
87 | - <span id="reset-stats"><?php _e( '<strong>Deletes</strong> ALL transaction records, donors, and related log entries regardless of test or live mode.', 'give' ); ?></span> |
|
84 | + <span id="recount-customer-stats"><?php esc_html_e('Recalculates the lifetime value and donation counts for all donors.', 'give'); ?></span> |
|
85 | + <?php do_action('give_recount_tool_descriptions'); ?> |
|
86 | + <span id="delete-test-transactions"><?php _e('<strong>Deletes</strong> all TEST payment records, donors, and related log entries.', 'give'); ?></span> |
|
87 | + <span id="reset-stats"><?php _e('<strong>Deletes</strong> ALL transaction records, donors, and related log entries regardless of test or live mode.', 'give'); ?></span> |
|
88 | 88 | </span> |
89 | 89 | |
90 | 90 | <span class="spinner"></span> |
91 | 91 | |
92 | 92 | </form> |
93 | - <?php do_action( 'give_tools_recount_forms' ); ?> |
|
93 | + <?php do_action('give_tools_recount_forms'); ?> |
|
94 | 94 | </div><!-- .inside --> |
95 | 95 | </div><!-- .postbox --> |
96 | 96 | </div><!-- #poststuff --> |
97 | 97 | <?php |
98 | - do_action( 'give_tools_recount_stats_after' ); |
|
98 | + do_action('give_tools_recount_stats_after'); |
|
99 | 99 | } |
100 | 100 | |
101 | -add_action( 'give_reports_tab_tools', 'give_tools_recount_stats_display' ); |
|
101 | +add_action('give_reports_tab_tools', 'give_tools_recount_stats_display'); |