@@ -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 | |
@@ -43,15 +43,15 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function __setup_hooks() { |
| 45 | 45 | // Create the log post type |
| 46 | - add_action( 'init', array( $this, 'register_post_type' ), 1 ); |
|
| 46 | + add_action('init', array($this, 'register_post_type'), 1); |
|
| 47 | 47 | |
| 48 | 48 | // Create types taxonomy and default types |
| 49 | - add_action( 'init', array( $this, 'register_taxonomy' ), 1 ); |
|
| 49 | + add_action('init', array($this, 'register_taxonomy'), 1); |
|
| 50 | 50 | |
| 51 | - add_action( 'save_post_give_payment', array( $this, 'background_process_delete_cache' ) ); |
|
| 52 | - add_action( 'save_post_give_forms', array( $this, 'background_process_delete_cache' ) ); |
|
| 53 | - add_action( 'save_post_give_log', array( $this, 'background_process_delete_cache' ) ); |
|
| 54 | - add_action( 'give_delete_log_cache', array( $this, 'delete_cache' ) ); |
|
| 51 | + add_action('save_post_give_payment', array($this, 'background_process_delete_cache')); |
|
| 52 | + add_action('save_post_give_forms', array($this, 'background_process_delete_cache')); |
|
| 53 | + add_action('save_post_give_log', array($this, 'background_process_delete_cache')); |
|
| 54 | + add_action('give_delete_log_cache', array($this, 'delete_cache')); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | /* Logs post type */ |
| 69 | 69 | $log_args = array( |
| 70 | 70 | 'labels' => array( |
| 71 | - 'name' => esc_html__( 'Logs', 'give' ), |
|
| 71 | + 'name' => esc_html__('Logs', 'give'), |
|
| 72 | 72 | ), |
| 73 | 73 | 'public' => false, |
| 74 | 74 | 'exclude_from_search' => true, |
@@ -77,11 +77,11 @@ discard block |
||
| 77 | 77 | 'query_var' => false, |
| 78 | 78 | 'rewrite' => false, |
| 79 | 79 | 'capability_type' => 'post', |
| 80 | - 'supports' => array( 'title', 'editor' ), |
|
| 80 | + 'supports' => array('title', 'editor'), |
|
| 81 | 81 | 'can_export' => true, |
| 82 | 82 | ); |
| 83 | 83 | |
| 84 | - register_post_type( 'give_log', $log_args ); |
|
| 84 | + register_post_type('give_log', $log_args); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -95,9 +95,9 @@ discard block |
||
| 95 | 95 | * @return void |
| 96 | 96 | */ |
| 97 | 97 | public function register_taxonomy() { |
| 98 | - register_taxonomy( 'give_log_type', 'give_log', array( |
|
| 98 | + register_taxonomy('give_log_type', 'give_log', array( |
|
| 99 | 99 | 'public' => false, |
| 100 | - ) ); |
|
| 100 | + )); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | 'api_request', |
| 118 | 118 | ); |
| 119 | 119 | |
| 120 | - return apply_filters( 'give_log_types', $terms ); |
|
| 120 | + return apply_filters('give_log_types', $terms); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -132,8 +132,8 @@ discard block |
||
| 132 | 132 | * |
| 133 | 133 | * @return bool Whether log type is valid. |
| 134 | 134 | */ |
| 135 | - public function valid_type( $type ) { |
|
| 136 | - return in_array( $type, $this->log_types() ); |
|
| 135 | + public function valid_type($type) { |
|
| 136 | + return in_array($type, $this->log_types()); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | * |
| 153 | 153 | * @return int Log ID. |
| 154 | 154 | */ |
| 155 | - public function add( $title = '', $message = '', $parent = 0, $type = null ) { |
|
| 155 | + public function add($title = '', $message = '', $parent = 0, $type = null) { |
|
| 156 | 156 | $log_data = array( |
| 157 | 157 | 'post_title' => $title, |
| 158 | 158 | 'post_content' => $message, |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | 'log_type' => $type, |
| 161 | 161 | ); |
| 162 | 162 | |
| 163 | - return $this->insert_log( $log_data ); |
|
| 163 | + return $this->insert_log($log_data); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | /** |
@@ -177,12 +177,12 @@ discard block |
||
| 177 | 177 | * |
| 178 | 178 | * @return array An array of the connected logs. |
| 179 | 179 | */ |
| 180 | - public function get_logs( $object_id = 0, $type = null, $paged = null ) { |
|
| 181 | - return $this->get_connected_logs( array( |
|
| 180 | + public function get_logs($object_id = 0, $type = null, $paged = null) { |
|
| 181 | + return $this->get_connected_logs(array( |
|
| 182 | 182 | 'post_parent' => $object_id, |
| 183 | 183 | 'paged' => $paged, |
| 184 | 184 | 'log_type' => $type, |
| 185 | - ) ); |
|
| 185 | + )); |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | /** |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | * |
| 197 | 197 | * @return int The ID of the newly created log item. |
| 198 | 198 | */ |
| 199 | - public function insert_log( $log_data = array(), $log_meta = array() ) { |
|
| 199 | + public function insert_log($log_data = array(), $log_meta = array()) { |
|
| 200 | 200 | $defaults = array( |
| 201 | 201 | 'post_type' => 'give_log', |
| 202 | 202 | 'post_status' => 'publish', |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | 'log_type' => false, |
| 206 | 206 | ); |
| 207 | 207 | |
| 208 | - $args = wp_parse_args( $log_data, $defaults ); |
|
| 208 | + $args = wp_parse_args($log_data, $defaults); |
|
| 209 | 209 | |
| 210 | 210 | /** |
| 211 | 211 | * Fires before inserting log entry. |
@@ -215,20 +215,20 @@ discard block |
||
| 215 | 215 | * @param array $log_data Log entry data. |
| 216 | 216 | * @param array $log_meta Log entry meta. |
| 217 | 217 | */ |
| 218 | - do_action( 'give_pre_insert_log', $log_data, $log_meta ); |
|
| 218 | + do_action('give_pre_insert_log', $log_data, $log_meta); |
|
| 219 | 219 | |
| 220 | 220 | // Store the log entry |
| 221 | - $log_id = wp_insert_post( $args ); |
|
| 221 | + $log_id = wp_insert_post($args); |
|
| 222 | 222 | |
| 223 | 223 | // Set the log type, if any |
| 224 | - if ( $log_data['log_type'] && $this->valid_type( $log_data['log_type'] ) ) { |
|
| 225 | - wp_set_object_terms( $log_id, $log_data['log_type'], 'give_log_type', false ); |
|
| 224 | + if ($log_data['log_type'] && $this->valid_type($log_data['log_type'])) { |
|
| 225 | + wp_set_object_terms($log_id, $log_data['log_type'], 'give_log_type', false); |
|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | // Set log meta, if any |
| 229 | - if ( $log_id && ! empty( $log_meta ) ) { |
|
| 230 | - foreach ( (array) $log_meta as $key => $meta ) { |
|
| 231 | - update_post_meta( $log_id, '_give_log_' . sanitize_key( $key ), $meta ); |
|
| 229 | + if ($log_id && ! empty($log_meta)) { |
|
| 230 | + foreach ((array) $log_meta as $key => $meta) { |
|
| 231 | + update_post_meta($log_id, '_give_log_'.sanitize_key($key), $meta); |
|
| 232 | 232 | } |
| 233 | 233 | } |
| 234 | 234 | |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | * @param array $log_data Log entry data. |
| 242 | 242 | * @param array $log_meta Log entry meta. |
| 243 | 243 | */ |
| 244 | - do_action( 'give_post_insert_log', $log_id, $log_data, $log_meta ); |
|
| 244 | + do_action('give_post_insert_log', $log_id, $log_data, $log_meta); |
|
| 245 | 245 | |
| 246 | 246 | return $log_id; |
| 247 | 247 | } |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | * |
| 258 | 258 | * @return bool|null True if successful, false otherwise. |
| 259 | 259 | */ |
| 260 | - public function update_log( $log_data = array(), $log_meta = array() ) { |
|
| 260 | + public function update_log($log_data = array(), $log_meta = array()) { |
|
| 261 | 261 | |
| 262 | 262 | /** |
| 263 | 263 | * Fires before updating log entry. |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | * @param array $log_data Log entry data. |
| 268 | 268 | * @param array $log_meta Log entry meta. |
| 269 | 269 | */ |
| 270 | - do_action( 'give_pre_update_log', $log_data, $log_meta ); |
|
| 270 | + do_action('give_pre_update_log', $log_data, $log_meta); |
|
| 271 | 271 | |
| 272 | 272 | $defaults = array( |
| 273 | 273 | 'post_type' => 'give_log', |
@@ -275,15 +275,15 @@ discard block |
||
| 275 | 275 | 'post_parent' => 0, |
| 276 | 276 | ); |
| 277 | 277 | |
| 278 | - $args = wp_parse_args( $log_data, $defaults ); |
|
| 278 | + $args = wp_parse_args($log_data, $defaults); |
|
| 279 | 279 | |
| 280 | 280 | // Store the log entry |
| 281 | - $log_id = wp_update_post( $args ); |
|
| 281 | + $log_id = wp_update_post($args); |
|
| 282 | 282 | |
| 283 | - if ( $log_id && ! empty( $log_meta ) ) { |
|
| 284 | - foreach ( (array) $log_meta as $key => $meta ) { |
|
| 285 | - if ( ! empty( $meta ) ) { |
|
| 286 | - update_post_meta( $log_id, '_give_log_' . sanitize_key( $key ), $meta ); |
|
| 283 | + if ($log_id && ! empty($log_meta)) { |
|
| 284 | + foreach ((array) $log_meta as $key => $meta) { |
|
| 285 | + if ( ! empty($meta)) { |
|
| 286 | + update_post_meta($log_id, '_give_log_'.sanitize_key($key), $meta); |
|
| 287 | 287 | } |
| 288 | 288 | } |
| 289 | 289 | } |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | * @param array $log_data Log entry data. |
| 298 | 298 | * @param array $log_meta Log entry meta. |
| 299 | 299 | */ |
| 300 | - do_action( 'give_post_update_log', $log_id, $log_data, $log_meta ); |
|
| 300 | + do_action('give_post_update_log', $log_id, $log_data, $log_meta); |
|
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | /** |
@@ -312,19 +312,19 @@ discard block |
||
| 312 | 312 | * |
| 313 | 313 | * @return array|false Array if logs were found, false otherwise. |
| 314 | 314 | */ |
| 315 | - public function get_connected_logs( $args = array() ) { |
|
| 315 | + public function get_connected_logs($args = array()) { |
|
| 316 | 316 | |
| 317 | 317 | $defaults = array( |
| 318 | 318 | 'post_type' => 'give_log', |
| 319 | 319 | 'posts_per_page' => 20, |
| 320 | 320 | 'post_status' => 'publish', |
| 321 | - 'paged' => get_query_var( 'paged' ), |
|
| 321 | + 'paged' => get_query_var('paged'), |
|
| 322 | 322 | 'log_type' => false, |
| 323 | 323 | ); |
| 324 | 324 | |
| 325 | - $query_args = wp_parse_args( $args, $defaults ); |
|
| 325 | + $query_args = wp_parse_args($args, $defaults); |
|
| 326 | 326 | |
| 327 | - if ( $query_args['log_type'] && $this->valid_type( $query_args['log_type'] ) ) { |
|
| 327 | + if ($query_args['log_type'] && $this->valid_type($query_args['log_type'])) { |
|
| 328 | 328 | $query_args['tax_query'] = array( |
| 329 | 329 | array( |
| 330 | 330 | 'taxonomy' => 'give_log_type', |
@@ -334,9 +334,9 @@ discard block |
||
| 334 | 334 | ); |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | - $logs = get_posts( $query_args ); |
|
| 337 | + $logs = get_posts($query_args); |
|
| 338 | 338 | |
| 339 | - if ( $logs ) { |
|
| 339 | + if ($logs) { |
|
| 340 | 340 | return $logs; |
| 341 | 341 | } |
| 342 | 342 | |
@@ -359,20 +359,20 @@ discard block |
||
| 359 | 359 | * |
| 360 | 360 | * @return int Log count. |
| 361 | 361 | */ |
| 362 | - public function get_log_count( $object_id = 0, $type = null, $meta_query = null, $date_query = null ) { |
|
| 362 | + public function get_log_count($object_id = 0, $type = null, $meta_query = null, $date_query = null) { |
|
| 363 | 363 | |
| 364 | 364 | $query_args = array( |
| 365 | 365 | 'post_type' => 'give_log', |
| 366 | - 'posts_per_page' => - 1, |
|
| 366 | + 'posts_per_page' => -1, |
|
| 367 | 367 | 'post_status' => 'publish', |
| 368 | 368 | 'fields' => 'ids', |
| 369 | 369 | ); |
| 370 | 370 | |
| 371 | - if ( $object_id ) { |
|
| 371 | + if ($object_id) { |
|
| 372 | 372 | $query_args['post_parent'] = $object_id; |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | - if ( ! empty( $type ) && $this->valid_type( $type ) ) { |
|
| 375 | + if ( ! empty($type) && $this->valid_type($type)) { |
|
| 376 | 376 | $query_args['tax_query'] = array( |
| 377 | 377 | array( |
| 378 | 378 | 'taxonomy' => 'give_log_type', |
@@ -382,24 +382,24 @@ discard block |
||
| 382 | 382 | ); |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | - if ( ! empty( $meta_query ) ) { |
|
| 385 | + if ( ! empty($meta_query)) { |
|
| 386 | 386 | $query_args['meta_query'] = $meta_query; |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | - if ( ! empty( $date_query ) ) { |
|
| 389 | + if ( ! empty($date_query)) { |
|
| 390 | 390 | $query_args['date_query'] = $date_query; |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | // Get cache key for current query. |
| 394 | - $cache_key = give_get_cache_key( 'get_log_count', $query_args ); |
|
| 394 | + $cache_key = give_get_cache_key('get_log_count', $query_args); |
|
| 395 | 395 | |
| 396 | 396 | // check if cache already exist or not. |
| 397 | - if ( ! ( $logs_count = get_option( $cache_key ) ) ) { |
|
| 398 | - $logs = new WP_Query( $query_args ); |
|
| 397 | + if ( ! ($logs_count = get_option($cache_key))) { |
|
| 398 | + $logs = new WP_Query($query_args); |
|
| 399 | 399 | $logs_count = (int) $logs->post_count; |
| 400 | 400 | |
| 401 | 401 | // Cache results. |
| 402 | - add_option( $cache_key, $logs_count, '', 'no' ); |
|
| 402 | + add_option($cache_key, $logs_count, '', 'no'); |
|
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | return $logs_count; |
@@ -419,16 +419,16 @@ discard block |
||
| 419 | 419 | * |
| 420 | 420 | * @return void |
| 421 | 421 | */ |
| 422 | - public function delete_logs( $object_id = 0, $type = null, $meta_query = null ) { |
|
| 422 | + public function delete_logs($object_id = 0, $type = null, $meta_query = null) { |
|
| 423 | 423 | $query_args = array( |
| 424 | 424 | 'post_parent' => $object_id, |
| 425 | 425 | 'post_type' => 'give_log', |
| 426 | - 'posts_per_page' => - 1, |
|
| 426 | + 'posts_per_page' => -1, |
|
| 427 | 427 | 'post_status' => 'publish', |
| 428 | 428 | 'fields' => 'ids', |
| 429 | 429 | ); |
| 430 | 430 | |
| 431 | - if ( ! empty( $type ) && $this->valid_type( $type ) ) { |
|
| 431 | + if ( ! empty($type) && $this->valid_type($type)) { |
|
| 432 | 432 | $query_args['tax_query'] = array( |
| 433 | 433 | array( |
| 434 | 434 | 'taxonomy' => 'give_log_type', |
@@ -438,15 +438,15 @@ discard block |
||
| 438 | 438 | ); |
| 439 | 439 | } |
| 440 | 440 | |
| 441 | - if ( ! empty( $meta_query ) ) { |
|
| 441 | + if ( ! empty($meta_query)) { |
|
| 442 | 442 | $query_args['meta_query'] = $meta_query; |
| 443 | 443 | } |
| 444 | 444 | |
| 445 | - $logs = get_posts( $query_args ); |
|
| 445 | + $logs = get_posts($query_args); |
|
| 446 | 446 | |
| 447 | - if ( $logs ) { |
|
| 448 | - foreach ( $logs as $log ) { |
|
| 449 | - wp_delete_post( $log, true ); |
|
| 447 | + if ($logs) { |
|
| 448 | + foreach ($logs as $log) { |
|
| 449 | + wp_delete_post($log, true); |
|
| 450 | 450 | } |
| 451 | 451 | } |
| 452 | 452 | } |
@@ -459,8 +459,8 @@ discard block |
||
| 459 | 459 | * |
| 460 | 460 | * @param int $post_id |
| 461 | 461 | */ |
| 462 | - public function background_process_delete_cache( $post_id ) { |
|
| 463 | - wp_schedule_single_event( time(), 'give_delete_log_cache' ); |
|
| 462 | + public function background_process_delete_cache($post_id) { |
|
| 463 | + wp_schedule_single_event(time(), 'give_delete_log_cache'); |
|
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | /** |
@@ -482,13 +482,13 @@ discard block |
||
| 482 | 482 | ); |
| 483 | 483 | |
| 484 | 484 | // Bailout. |
| 485 | - if ( empty( $cache_option_names ) ) { |
|
| 485 | + if (empty($cache_option_names)) { |
|
| 486 | 486 | return false; |
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | // Delete log cache. |
| 490 | - foreach ( $cache_option_names as $option_name ) { |
|
| 491 | - delete_option( $option_name['option_name'] ); |
|
| 490 | + foreach ($cache_option_names as $option_name) { |
|
| 491 | + delete_option($option_name['option_name']); |
|
| 492 | 492 | } |
| 493 | 493 | } |
| 494 | 494 | } |
@@ -511,10 +511,10 @@ discard block |
||
| 511 | 511 | * |
| 512 | 512 | * @return int ID of the new log entry. |
| 513 | 513 | */ |
| 514 | -function give_record_log( $title = '', $message = '', $parent = 0, $type = null ) { |
|
| 514 | +function give_record_log($title = '', $message = '', $parent = 0, $type = null) { |
|
| 515 | 515 | /* @var Give_Logging $give_logs */ |
| 516 | 516 | global $give_logs; |
| 517 | - $log = $give_logs->add( $title, $message, $parent, $type ); |
|
| 517 | + $log = $give_logs->add($title, $message, $parent, $type); |
|
| 518 | 518 | |
| 519 | 519 | return $log; |
| 520 | 520 | } |
@@ -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 | |
@@ -25,25 +25,25 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | function give_load_scripts() { |
| 27 | 27 | |
| 28 | - $js_dir = GIVE_PLUGIN_URL . 'assets/js/frontend/'; |
|
| 29 | - $js_plugins = GIVE_PLUGIN_URL . 'assets/js/plugins/'; |
|
| 30 | - $scripts_footer = ( give_is_setting_enabled( give_get_option( 'scripts_footer' ) ) ) ? true : false; |
|
| 28 | + $js_dir = GIVE_PLUGIN_URL.'assets/js/frontend/'; |
|
| 29 | + $js_plugins = GIVE_PLUGIN_URL.'assets/js/plugins/'; |
|
| 30 | + $scripts_footer = (give_is_setting_enabled(give_get_option('scripts_footer'))) ? true : false; |
|
| 31 | 31 | |
| 32 | 32 | // Use minified libraries if SCRIPT_DEBUG is turned off. |
| 33 | - $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
|
| 33 | + $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
| 34 | 34 | |
| 35 | 35 | // Localize / PHP to AJAX vars. |
| 36 | - $localize_give_vars = apply_filters( 'give_global_script_vars', array( |
|
| 36 | + $localize_give_vars = apply_filters('give_global_script_vars', array( |
|
| 37 | 37 | 'ajaxurl' => give_get_ajax_url(), |
| 38 | - 'checkout_nonce' => wp_create_nonce( 'give_checkout_nonce' ), |
|
| 39 | - 'currency_sign' => give_currency_filter( '' ), |
|
| 38 | + 'checkout_nonce' => wp_create_nonce('give_checkout_nonce'), |
|
| 39 | + 'currency_sign' => give_currency_filter(''), |
|
| 40 | 40 | 'currency_pos' => give_get_currency_position(), |
| 41 | 41 | 'thousands_separator' => give_get_price_thousand_separator(), |
| 42 | 42 | 'decimal_separator' => give_get_price_decimal_separator(), |
| 43 | - 'no_gateway' => __( 'Please select a payment method.', 'give' ), |
|
| 44 | - 'bad_minimum' => __( 'The minimum donation amount for this form is', 'give' ), |
|
| 45 | - 'general_loading' => __( 'Loading...', 'give' ), |
|
| 46 | - 'purchase_loading' => __( 'Please Wait...', 'give' ), |
|
| 43 | + 'no_gateway' => __('Please select a payment method.', 'give'), |
|
| 44 | + 'bad_minimum' => __('The minimum donation amount for this form is', 'give'), |
|
| 45 | + 'general_loading' => __('Loading...', 'give'), |
|
| 46 | + 'purchase_loading' => __('Please Wait...', 'give'), |
|
| 47 | 47 | 'number_decimals' => give_get_price_decimals(), |
| 48 | 48 | 'give_version' => GIVE_VERSION, |
| 49 | 49 | 'magnific_options' => apply_filters( |
@@ -57,81 +57,81 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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?#iefixngjl88'?>') 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?#iefixngjl88'?>') 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 |
||
| 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 |
||
| 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'); |
|
@@ -40,11 +40,11 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | |
| 42 | 42 | // Exit if accessed directly. |
| 43 | -if ( ! defined( 'ABSPATH' ) ) {
|
|
| 43 | +if ( ! defined('ABSPATH')) {
|
|
| 44 | 44 | exit; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | -if ( ! class_exists( 'Give' ) ) : |
|
| 47 | +if ( ! class_exists('Give')) :
|
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Main Give Class |
@@ -195,11 +195,11 @@ discard block |
||
| 195 | 195 | * @return Give |
| 196 | 196 | */ |
| 197 | 197 | public static function instance() {
|
| 198 | - if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Give ) ) {
|
|
| 198 | + if ( ! isset(self::$instance) && ! (self::$instance instanceof Give)) {
|
|
| 199 | 199 | self::$instance = new Give; |
| 200 | 200 | self::$instance->setup_constants(); |
| 201 | 201 | |
| 202 | - add_action( 'plugins_loaded', array( self::$instance, 'load_textdomain' ) ); |
|
| 202 | + add_action('plugins_loaded', array(self::$instance, 'load_textdomain'));
|
|
| 203 | 203 | |
| 204 | 204 | self::$instance->includes(); |
| 205 | 205 | self::$instance->roles = new Give_Roles(); |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | */ |
| 233 | 233 | public function __clone() {
|
| 234 | 234 | // Cloning instances of the class is forbidden |
| 235 | - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'give' ), '1.0' ); |
|
| 235 | + _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?', 'give'), '1.0');
|
|
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | /** |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | */ |
| 246 | 246 | public function __wakeup() {
|
| 247 | 247 | // Unserializing instances of the class is forbidden. |
| 248 | - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'give' ), '1.0' ); |
|
| 248 | + _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?', 'give'), '1.0');
|
|
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | /** |
@@ -259,33 +259,33 @@ discard block |
||
| 259 | 259 | private function setup_constants() {
|
| 260 | 260 | |
| 261 | 261 | // Plugin version |
| 262 | - if ( ! defined( 'GIVE_VERSION' ) ) {
|
|
| 263 | - define( 'GIVE_VERSION', '1.8.3' ); |
|
| 262 | + if ( ! defined('GIVE_VERSION')) {
|
|
| 263 | + define('GIVE_VERSION', '1.8.3');
|
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | // Plugin Folder Path |
| 267 | - if ( ! defined( 'GIVE_PLUGIN_DIR' ) ) {
|
|
| 268 | - define( 'GIVE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
|
| 267 | + if ( ! defined('GIVE_PLUGIN_DIR')) {
|
|
| 268 | + define('GIVE_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
|
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | // Plugin Folder URL |
| 272 | - if ( ! defined( 'GIVE_PLUGIN_URL' ) ) {
|
|
| 273 | - define( 'GIVE_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
|
| 272 | + if ( ! defined('GIVE_PLUGIN_URL')) {
|
|
| 273 | + define('GIVE_PLUGIN_URL', plugin_dir_url(__FILE__));
|
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | // Plugin Basename aka: "give/give.php" |
| 277 | - if ( ! defined( 'GIVE_PLUGIN_BASENAME' ) ) {
|
|
| 278 | - define( 'GIVE_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); |
|
| 277 | + if ( ! defined('GIVE_PLUGIN_BASENAME')) {
|
|
| 278 | + define('GIVE_PLUGIN_BASENAME', plugin_basename(__FILE__));
|
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | // Plugin Root File |
| 282 | - if ( ! defined( 'GIVE_PLUGIN_FILE' ) ) {
|
|
| 283 | - define( 'GIVE_PLUGIN_FILE', __FILE__ ); |
|
| 282 | + if ( ! defined('GIVE_PLUGIN_FILE')) {
|
|
| 283 | + define('GIVE_PLUGIN_FILE', __FILE__);
|
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | // Make sure CAL_GREGORIAN is defined |
| 287 | - if ( ! defined( 'CAL_GREGORIAN' ) ) {
|
|
| 288 | - define( 'CAL_GREGORIAN', 1 ); |
|
| 287 | + if ( ! defined('CAL_GREGORIAN')) {
|
|
| 288 | + define('CAL_GREGORIAN', 1);
|
|
| 289 | 289 | } |
| 290 | 290 | } |
| 291 | 291 | |
@@ -300,122 +300,122 @@ discard block |
||
| 300 | 300 | private function includes() {
|
| 301 | 301 | global $give_options; |
| 302 | 302 | |
| 303 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-admin-settings.php'; |
|
| 304 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-give-settings.php'; |
|
| 303 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-admin-settings.php'; |
|
| 304 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-give-settings.php'; |
|
| 305 | 305 | $give_options = give_get_settings(); |
| 306 | 306 | |
| 307 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/give-metabox-functions.php'; |
|
| 308 | - require_once GIVE_PLUGIN_DIR . 'includes/post-types.php'; |
|
| 309 | - require_once GIVE_PLUGIN_DIR . 'includes/scripts.php'; |
|
| 310 | - require_once GIVE_PLUGIN_DIR . 'includes/ajax-functions.php'; |
|
| 311 | - require_once GIVE_PLUGIN_DIR . 'includes/actions.php'; |
|
| 312 | - require_once GIVE_PLUGIN_DIR . 'includes/filters.php'; |
|
| 313 | - require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api.php'; |
|
| 314 | - |
|
| 315 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-roles.php'; |
|
| 316 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-template-loader.php'; |
|
| 317 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-donate-form.php'; |
|
| 318 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-db.php'; |
|
| 319 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-customers.php'; |
|
| 320 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-customer-meta.php'; |
|
| 321 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-customer.php'; |
|
| 322 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-stats.php'; |
|
| 323 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-session.php'; |
|
| 324 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-html-elements.php'; |
|
| 325 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-logging.php'; |
|
| 326 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-license-handler.php'; |
|
| 327 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-cron.php'; |
|
| 328 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-email-access.php'; |
|
| 329 | - |
|
| 330 | - require_once GIVE_PLUGIN_DIR . 'includes/country-functions.php'; |
|
| 331 | - require_once GIVE_PLUGIN_DIR . 'includes/template-functions.php'; |
|
| 332 | - require_once GIVE_PLUGIN_DIR . 'includes/misc-functions.php'; |
|
| 333 | - require_once GIVE_PLUGIN_DIR . 'includes/forms/functions.php'; |
|
| 334 | - require_once GIVE_PLUGIN_DIR . 'includes/forms/template.php'; |
|
| 335 | - require_once GIVE_PLUGIN_DIR . 'includes/forms/widget.php'; |
|
| 336 | - require_once GIVE_PLUGIN_DIR . 'includes/shortcodes.php'; |
|
| 337 | - require_once GIVE_PLUGIN_DIR . 'includes/formatting.php'; |
|
| 338 | - require_once GIVE_PLUGIN_DIR . 'includes/price-functions.php'; |
|
| 339 | - require_once GIVE_PLUGIN_DIR . 'includes/error-tracking.php'; |
|
| 340 | - require_once GIVE_PLUGIN_DIR . 'includes/process-donation.php'; |
|
| 341 | - require_once GIVE_PLUGIN_DIR . 'includes/login-register.php'; |
|
| 342 | - require_once GIVE_PLUGIN_DIR . 'includes/user-functions.php'; |
|
| 343 | - require_once GIVE_PLUGIN_DIR . 'includes/plugin-compatibility.php'; |
|
| 344 | - require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-functions.php'; |
|
| 345 | - require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-actions.php'; |
|
| 346 | - require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-filters.php'; |
|
| 347 | - |
|
| 348 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/functions.php'; |
|
| 349 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/actions.php'; |
|
| 350 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payment-stats.php'; |
|
| 351 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payments-query.php'; |
|
| 352 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-payment.php'; |
|
| 353 | - |
|
| 354 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/functions.php'; |
|
| 355 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/actions.php'; |
|
| 356 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/paypal-standard.php'; |
|
| 357 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/offline-donations.php'; |
|
| 358 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/manual.php'; |
|
| 359 | - |
|
| 360 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-emails.php'; |
|
| 361 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-email-tags.php'; |
|
| 362 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/functions.php'; |
|
| 363 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/template.php'; |
|
| 364 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/actions.php'; |
|
| 365 | - |
|
| 366 | - if( defined( 'WP_CLI' ) && WP_CLI ) {
|
|
| 367 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-cli-commands.php'; |
|
| 307 | + require_once GIVE_PLUGIN_DIR.'includes/admin/give-metabox-functions.php'; |
|
| 308 | + require_once GIVE_PLUGIN_DIR.'includes/post-types.php'; |
|
| 309 | + require_once GIVE_PLUGIN_DIR.'includes/scripts.php'; |
|
| 310 | + require_once GIVE_PLUGIN_DIR.'includes/ajax-functions.php'; |
|
| 311 | + require_once GIVE_PLUGIN_DIR.'includes/actions.php'; |
|
| 312 | + require_once GIVE_PLUGIN_DIR.'includes/filters.php'; |
|
| 313 | + require_once GIVE_PLUGIN_DIR.'includes/api/class-give-api.php'; |
|
| 314 | + |
|
| 315 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-roles.php'; |
|
| 316 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-template-loader.php'; |
|
| 317 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-donate-form.php'; |
|
| 318 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-db.php'; |
|
| 319 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-db-customers.php'; |
|
| 320 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-db-customer-meta.php'; |
|
| 321 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-customer.php'; |
|
| 322 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-stats.php'; |
|
| 323 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-session.php'; |
|
| 324 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-html-elements.php'; |
|
| 325 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-logging.php'; |
|
| 326 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-license-handler.php'; |
|
| 327 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-cron.php'; |
|
| 328 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-email-access.php'; |
|
| 329 | + |
|
| 330 | + require_once GIVE_PLUGIN_DIR.'includes/country-functions.php'; |
|
| 331 | + require_once GIVE_PLUGIN_DIR.'includes/template-functions.php'; |
|
| 332 | + require_once GIVE_PLUGIN_DIR.'includes/misc-functions.php'; |
|
| 333 | + require_once GIVE_PLUGIN_DIR.'includes/forms/functions.php'; |
|
| 334 | + require_once GIVE_PLUGIN_DIR.'includes/forms/template.php'; |
|
| 335 | + require_once GIVE_PLUGIN_DIR.'includes/forms/widget.php'; |
|
| 336 | + require_once GIVE_PLUGIN_DIR.'includes/shortcodes.php'; |
|
| 337 | + require_once GIVE_PLUGIN_DIR.'includes/formatting.php'; |
|
| 338 | + require_once GIVE_PLUGIN_DIR.'includes/price-functions.php'; |
|
| 339 | + require_once GIVE_PLUGIN_DIR.'includes/error-tracking.php'; |
|
| 340 | + require_once GIVE_PLUGIN_DIR.'includes/process-donation.php'; |
|
| 341 | + require_once GIVE_PLUGIN_DIR.'includes/login-register.php'; |
|
| 342 | + require_once GIVE_PLUGIN_DIR.'includes/user-functions.php'; |
|
| 343 | + require_once GIVE_PLUGIN_DIR.'includes/plugin-compatibility.php'; |
|
| 344 | + require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-functions.php'; |
|
| 345 | + require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-actions.php'; |
|
| 346 | + require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-filters.php'; |
|
| 347 | + |
|
| 348 | + require_once GIVE_PLUGIN_DIR.'includes/payments/functions.php'; |
|
| 349 | + require_once GIVE_PLUGIN_DIR.'includes/payments/actions.php'; |
|
| 350 | + require_once GIVE_PLUGIN_DIR.'includes/payments/class-payment-stats.php'; |
|
| 351 | + require_once GIVE_PLUGIN_DIR.'includes/payments/class-payments-query.php'; |
|
| 352 | + require_once GIVE_PLUGIN_DIR.'includes/payments/class-give-payment.php'; |
|
| 353 | + |
|
| 354 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/functions.php'; |
|
| 355 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/actions.php'; |
|
| 356 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/paypal-standard.php'; |
|
| 357 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/offline-donations.php'; |
|
| 358 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/manual.php'; |
|
| 359 | + |
|
| 360 | + require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-emails.php'; |
|
| 361 | + require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-email-tags.php'; |
|
| 362 | + require_once GIVE_PLUGIN_DIR.'includes/emails/functions.php'; |
|
| 363 | + require_once GIVE_PLUGIN_DIR.'includes/emails/template.php'; |
|
| 364 | + require_once GIVE_PLUGIN_DIR.'includes/emails/actions.php'; |
|
| 365 | + |
|
| 366 | + if (defined('WP_CLI') && WP_CLI) {
|
|
| 367 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-cli-commands.php'; |
|
| 368 | 368 | } |
| 369 | 369 | |
| 370 | - if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
|
|
| 371 | - |
|
| 372 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-footer.php'; |
|
| 373 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/welcome.php'; |
|
| 374 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-pages.php'; |
|
| 375 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-admin-notices.php'; |
|
| 376 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php'; |
|
| 377 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-i18n-module.php'; |
|
| 378 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-actions.php'; |
|
| 379 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-filters.php'; |
|
| 380 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/system-info.php'; |
|
| 381 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/add-ons.php'; |
|
| 382 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/plugins.php'; |
|
| 383 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php'; |
|
| 384 | - |
|
| 385 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/actions.php'; |
|
| 386 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/payments-history.php'; |
|
| 387 | - |
|
| 388 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/customers/customers.php'; |
|
| 389 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/customers/customer-functions.php'; |
|
| 390 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/customers/customer-actions.php'; |
|
| 391 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/metabox.php'; |
|
| 392 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/class-metabox-form-data.php'; |
|
| 393 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/dashboard-columns.php'; |
|
| 394 | - |
|
| 395 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/export-functions.php'; |
|
| 396 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/reports.php'; |
|
| 397 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools.php'; |
|
| 398 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/tools-actions.php'; |
|
| 399 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/pdf-reports.php'; |
|
| 400 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-give-graph.php'; |
|
| 401 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/graphing.php'; |
|
| 402 | - |
|
| 403 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/abstract-shortcode-generator.php'; |
|
| 404 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/class-shortcode-button.php'; |
|
| 405 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-form.php'; |
|
| 406 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-goal.php'; |
|
| 407 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-login.php'; |
|
| 408 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-register.php'; |
|
| 409 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-profile-editor.php'; |
|
| 410 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-history.php'; |
|
| 411 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-receipt.php'; |
|
| 412 | - |
|
| 413 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php'; |
|
| 414 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrades.php'; |
|
| 370 | + if (is_admin() || (defined('WP_CLI') && WP_CLI)) {
|
|
| 371 | + |
|
| 372 | + require_once GIVE_PLUGIN_DIR.'includes/admin/admin-footer.php'; |
|
| 373 | + require_once GIVE_PLUGIN_DIR.'includes/admin/welcome.php'; |
|
| 374 | + require_once GIVE_PLUGIN_DIR.'includes/admin/admin-pages.php'; |
|
| 375 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-admin-notices.php'; |
|
| 376 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php'; |
|
| 377 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-i18n-module.php'; |
|
| 378 | + require_once GIVE_PLUGIN_DIR.'includes/admin/admin-actions.php'; |
|
| 379 | + require_once GIVE_PLUGIN_DIR.'includes/admin/admin-filters.php'; |
|
| 380 | + require_once GIVE_PLUGIN_DIR.'includes/admin/system-info.php'; |
|
| 381 | + require_once GIVE_PLUGIN_DIR.'includes/admin/add-ons.php'; |
|
| 382 | + require_once GIVE_PLUGIN_DIR.'includes/admin/plugins.php'; |
|
| 383 | + require_once GIVE_PLUGIN_DIR.'includes/admin/dashboard-widgets.php'; |
|
| 384 | + |
|
| 385 | + require_once GIVE_PLUGIN_DIR.'includes/admin/payments/actions.php'; |
|
| 386 | + require_once GIVE_PLUGIN_DIR.'includes/admin/payments/payments-history.php'; |
|
| 387 | + |
|
| 388 | + require_once GIVE_PLUGIN_DIR.'includes/admin/customers/customers.php'; |
|
| 389 | + require_once GIVE_PLUGIN_DIR.'includes/admin/customers/customer-functions.php'; |
|
| 390 | + require_once GIVE_PLUGIN_DIR.'includes/admin/customers/customer-actions.php'; |
|
| 391 | + require_once GIVE_PLUGIN_DIR.'includes/admin/forms/metabox.php'; |
|
| 392 | + require_once GIVE_PLUGIN_DIR.'includes/admin/forms/class-metabox-form-data.php'; |
|
| 393 | + require_once GIVE_PLUGIN_DIR.'includes/admin/forms/dashboard-columns.php'; |
|
| 394 | + |
|
| 395 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/export-functions.php'; |
|
| 396 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/reports.php'; |
|
| 397 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/tools.php'; |
|
| 398 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/tools-actions.php'; |
|
| 399 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/pdf-reports.php'; |
|
| 400 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-give-graph.php'; |
|
| 401 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/graphing.php'; |
|
| 402 | + |
|
| 403 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/abstract-shortcode-generator.php'; |
|
| 404 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/class-shortcode-button.php'; |
|
| 405 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-form.php'; |
|
| 406 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-goal.php'; |
|
| 407 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-login.php'; |
|
| 408 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-register.php'; |
|
| 409 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-profile-editor.php'; |
|
| 410 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-donation-history.php'; |
|
| 411 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-receipt.php'; |
|
| 412 | + |
|
| 413 | + require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/upgrade-functions.php'; |
|
| 414 | + require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/upgrades.php'; |
|
| 415 | 415 | |
| 416 | 416 | } |
| 417 | 417 | |
| 418 | - require_once GIVE_PLUGIN_DIR . 'includes/install.php'; |
|
| 418 | + require_once GIVE_PLUGIN_DIR.'includes/install.php'; |
|
| 419 | 419 | |
| 420 | 420 | } |
| 421 | 421 | |
@@ -429,26 +429,26 @@ discard block |
||
| 429 | 429 | */ |
| 430 | 430 | public function load_textdomain() {
|
| 431 | 431 | // Set filter for Give's languages directory |
| 432 | - $give_lang_dir = dirname( plugin_basename( GIVE_PLUGIN_FILE ) ) . '/languages/'; |
|
| 433 | - $give_lang_dir = apply_filters( 'give_languages_directory', $give_lang_dir ); |
|
| 432 | + $give_lang_dir = dirname(plugin_basename(GIVE_PLUGIN_FILE)).'/languages/'; |
|
| 433 | + $give_lang_dir = apply_filters('give_languages_directory', $give_lang_dir);
|
|
| 434 | 434 | |
| 435 | 435 | // Traditional WordPress plugin locale filter |
| 436 | - $locale = apply_filters( 'plugin_locale', get_locale(), 'give' ); |
|
| 437 | - $mofile = sprintf( '%1$s-%2$s.mo', 'give', $locale ); |
|
| 436 | + $locale = apply_filters('plugin_locale', get_locale(), 'give');
|
|
| 437 | + $mofile = sprintf('%1$s-%2$s.mo', 'give', $locale);
|
|
| 438 | 438 | |
| 439 | 439 | // Setup paths to current locale file |
| 440 | - $mofile_local = $give_lang_dir . $mofile; |
|
| 441 | - $mofile_global = WP_LANG_DIR . '/give/' . $mofile; |
|
| 440 | + $mofile_local = $give_lang_dir.$mofile; |
|
| 441 | + $mofile_global = WP_LANG_DIR.'/give/'.$mofile; |
|
| 442 | 442 | |
| 443 | - if ( file_exists( $mofile_global ) ) {
|
|
| 443 | + if (file_exists($mofile_global)) {
|
|
| 444 | 444 | // Look in global /wp-content/languages/give folder |
| 445 | - load_textdomain( 'give', $mofile_global ); |
|
| 446 | - } elseif ( file_exists( $mofile_local ) ) {
|
|
| 445 | + load_textdomain('give', $mofile_global);
|
|
| 446 | + } elseif (file_exists($mofile_local)) {
|
|
| 447 | 447 | // Look in local location from filter `give_languages_directory` |
| 448 | - load_textdomain( 'give', $mofile_local ); |
|
| 448 | + load_textdomain('give', $mofile_local);
|
|
| 449 | 449 | } else {
|
| 450 | 450 | // Load the default language files packaged up w/ Give |
| 451 | - load_plugin_textdomain( 'give', false, $give_lang_dir ); |
|
| 451 | + load_plugin_textdomain('give', false, $give_lang_dir);
|
|
| 452 | 452 | } |
| 453 | 453 | } |
| 454 | 454 | |