@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Settings_Logs' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Logs')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Logs. |
@@ -43,16 +43,16 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function __construct() { |
45 | 45 | $this->id = 'logs'; |
46 | - $this->label = esc_html__( 'Logs', 'give' ); |
|
46 | + $this->label = esc_html__('Logs', 'give'); |
|
47 | 47 | |
48 | 48 | $this->default_tab = 'sales'; |
49 | 49 | |
50 | 50 | parent::__construct(); |
51 | 51 | |
52 | 52 | // Do not use main form for this tab. |
53 | - if ( give_get_current_setting_tab() === $this->id ) { |
|
54 | - add_action( 'give-tools_open_form', '__return_empty_string' ); |
|
55 | - add_action( 'give-tools_close_form', '__return_empty_string' ); |
|
53 | + if (give_get_current_setting_tab() === $this->id) { |
|
54 | + add_action('give-tools_open_form', '__return_empty_string'); |
|
55 | + add_action('give-tools_close_form', '__return_empty_string'); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | * |
66 | 66 | * @return array |
67 | 67 | */ |
68 | - public function add_settings_page( $pages ) { |
|
69 | - $pages[ $this->id ] = $this->label; |
|
68 | + public function add_settings_page($pages) { |
|
69 | + $pages[$this->id] = $this->label; |
|
70 | 70 | |
71 | 71 | return $pages; |
72 | 72 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $GLOBALS['give_hide_save_button'] = true; |
83 | 83 | |
84 | 84 | // Get settings. |
85 | - $settings = apply_filters( 'give_settings_logs', array( |
|
85 | + $settings = apply_filters('give_settings_logs', array( |
|
86 | 86 | array( |
87 | 87 | 'id' => 'give_tools_logs', |
88 | 88 | 'type' => 'title', |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | ), |
91 | 91 | array( |
92 | 92 | 'id' => 'api', |
93 | - 'name' => esc_html__( 'Log', 'give' ), |
|
93 | + 'name' => esc_html__('Log', 'give'), |
|
94 | 94 | 'type' => 'logs', |
95 | 95 | |
96 | 96 | ), |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | 'type' => 'sectionend', |
100 | 100 | 'table_html' => false, |
101 | 101 | ), |
102 | - ) ); |
|
102 | + )); |
|
103 | 103 | |
104 | 104 | /** |
105 | 105 | * Filter the settings. |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * |
109 | 109 | * @param array $settings |
110 | 110 | */ |
111 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
111 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
112 | 112 | |
113 | 113 | // Output. |
114 | 114 | return $settings; |
@@ -122,14 +122,14 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function get_sections() { |
124 | 124 | $sections = array( |
125 | - 'sales' => esc_html__( 'Donations', 'give' ), |
|
126 | - 'gateway_errors' => esc_html__( 'Payment Errors', 'give' ), |
|
127 | - 'api_requests' => esc_html__( 'API Requests', 'give' ), |
|
125 | + 'sales' => esc_html__('Donations', 'give'), |
|
126 | + 'gateway_errors' => esc_html__('Payment Errors', 'give'), |
|
127 | + 'api_requests' => esc_html__('API Requests', 'give'), |
|
128 | 128 | ); |
129 | 129 | |
130 | - $sections = apply_filters( 'give_log_views', $sections ); |
|
130 | + $sections = apply_filters('give_log_views', $sections); |
|
131 | 131 | |
132 | - return apply_filters( 'give_get_sections_' . $this->id, $sections ); |
|
132 | + return apply_filters('give_get_sections_'.$this->id, $sections); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | public function output() { |
142 | 142 | $settings = $this->get_settings(); |
143 | 143 | |
144 | - Give_Admin_Settings::output_fields( $settings, 'give_settings' ); |
|
144 | + Give_Admin_Settings::output_fields($settings, 'give_settings'); |
|
145 | 145 | } |
146 | 146 | } |
147 | 147 |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Settings_API' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_API')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_API. |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function __construct() { |
45 | 45 | $this->id = 'api'; |
46 | - $this->label = esc_html__( 'API', 'give' ); |
|
46 | + $this->label = esc_html__('API', 'give'); |
|
47 | 47 | |
48 | - add_filter( 'give-tools_tabs_array', array( $this, 'add_settings_page' ), 20 ); |
|
49 | - add_action( "give-tools_settings_{$this->id}_page", array( $this, 'output' ) ); |
|
48 | + add_filter('give-tools_tabs_array', array($this, 'add_settings_page'), 20); |
|
49 | + add_action("give-tools_settings_{$this->id}_page", array($this, 'output')); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | * @param array $pages Lst of pages. |
57 | 57 | * @return array |
58 | 58 | */ |
59 | - public function add_settings_page( $pages ) { |
|
60 | - $pages[ $this->id ] = $this->label; |
|
59 | + public function add_settings_page($pages) { |
|
60 | + $pages[$this->id] = $this->label; |
|
61 | 61 | |
62 | 62 | return $pages; |
63 | 63 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $GLOBALS['give_hide_save_button'] = true; |
74 | 74 | |
75 | 75 | // Get settings. |
76 | - $settings = apply_filters( 'give_settings_api', array( |
|
76 | + $settings = apply_filters('give_settings_api', array( |
|
77 | 77 | array( |
78 | 78 | 'id' => 'give_tools_api', |
79 | 79 | 'type' => 'title', |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | ), |
82 | 82 | array( |
83 | 83 | 'id' => 'api', |
84 | - 'name' => esc_html__( 'API', 'give' ), |
|
84 | + 'name' => esc_html__('API', 'give'), |
|
85 | 85 | 'type' => 'api', |
86 | 86 | ), |
87 | 87 | array( |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * @since 1.8 |
98 | 98 | * @param array $settings |
99 | 99 | */ |
100 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
100 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
101 | 101 | |
102 | 102 | // Output. |
103 | 103 | return $settings; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | public function output() { |
113 | 113 | $settings = $this->get_settings(); |
114 | 114 | |
115 | - Give_Admin_Settings::output_fields( $settings, 'give_settings' ); |
|
115 | + Give_Admin_Settings::output_fields($settings, 'give_settings'); |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Settings_Data' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Data')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Data. |
@@ -43,15 +43,15 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function __construct() { |
45 | 45 | $this->id = 'data'; |
46 | - $this->label = esc_html__( 'Data', 'give' ); |
|
46 | + $this->label = esc_html__('Data', 'give'); |
|
47 | 47 | |
48 | - add_filter( 'give-tools_tabs_array', array( $this, 'add_settings_page' ), 20 ); |
|
49 | - add_action( "give-tools_settings_{$this->id}_page", array( $this, 'output' ) ); |
|
48 | + add_filter('give-tools_tabs_array', array($this, 'add_settings_page'), 20); |
|
49 | + add_action("give-tools_settings_{$this->id}_page", array($this, 'output')); |
|
50 | 50 | |
51 | 51 | // Do not use main form for this tab. |
52 | - if( give_get_current_setting_tab() === $this->id ) { |
|
53 | - add_action( "give-tools_open_form", '__return_empty_string' ); |
|
54 | - add_action( "give-tools_close_form", '__return_empty_string' ); |
|
52 | + if (give_get_current_setting_tab() === $this->id) { |
|
53 | + add_action("give-tools_open_form", '__return_empty_string'); |
|
54 | + add_action("give-tools_close_form", '__return_empty_string'); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | * @param array $pages Lst of pages. |
63 | 63 | * @return array |
64 | 64 | */ |
65 | - public function add_settings_page( $pages ) { |
|
66 | - $pages[ $this->id ] = $this->label; |
|
65 | + public function add_settings_page($pages) { |
|
66 | + $pages[$this->id] = $this->label; |
|
67 | 67 | |
68 | 68 | return $pages; |
69 | 69 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $GLOBALS['give_hide_save_button'] = true; |
80 | 80 | |
81 | 81 | // Get settings. |
82 | - $settings = apply_filters( 'give_settings_data', array( |
|
82 | + $settings = apply_filters('give_settings_data', array( |
|
83 | 83 | array( |
84 | 84 | 'id' => 'give_tools_tools', |
85 | 85 | 'type' => 'title', |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | ), |
88 | 88 | array( |
89 | 89 | 'id' => 'api', |
90 | - 'name' => esc_html__( 'Tools', 'give' ), |
|
90 | + 'name' => esc_html__('Tools', 'give'), |
|
91 | 91 | 'type' => 'data', |
92 | 92 | ), |
93 | 93 | array( |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @since 1.8 |
104 | 104 | * @param array $settings |
105 | 105 | */ |
106 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
106 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
107 | 107 | |
108 | 108 | // Output. |
109 | 109 | return $settings; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | public function output() { |
119 | 119 | $settings = $this->get_settings(); |
120 | 120 | |
121 | - Give_Admin_Settings::output_fields( $settings, 'give_settings' ); |
|
121 | + Give_Admin_Settings::output_fields($settings, 'give_settings'); |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 |
@@ -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 | |
@@ -26,15 +26,15 @@ discard block |
||
26 | 26 | function give_donation_history() { |
27 | 27 | |
28 | 28 | // If payment_key query arg exists, return receipt instead of donation history. |
29 | - if ( isset( $_GET['payment_key'] ) ) { |
|
29 | + if (isset($_GET['payment_key'])) { |
|
30 | 30 | ob_start(); |
31 | - echo give_receipt_shortcode( array() ); |
|
32 | - echo '<a href="' . esc_url( give_get_history_page_uri() ) . '">« ' . esc_html__( 'Return to All Donations', 'give' ) . '</a>'; |
|
31 | + echo give_receipt_shortcode(array()); |
|
32 | + echo '<a href="'.esc_url(give_get_history_page_uri()).'">« '.esc_html__('Return to All Donations', 'give').'</a>'; |
|
33 | 33 | |
34 | 34 | return ob_get_clean(); |
35 | 35 | } |
36 | 36 | |
37 | - $email_access = give_get_option( 'email_access' ); |
|
37 | + $email_access = give_get_option('email_access'); |
|
38 | 38 | |
39 | 39 | /** |
40 | 40 | * Determine access |
@@ -44,28 +44,28 @@ discard block |
||
44 | 44 | */ |
45 | 45 | if ( |
46 | 46 | is_user_logged_in() || false !== Give()->session->get_session_expiration() |
47 | - || ( give_is_setting_enabled( $email_access ) && Give()->email_access->token_exists ) |
|
47 | + || (give_is_setting_enabled($email_access) && Give()->email_access->token_exists) |
|
48 | 48 | ) { |
49 | 49 | ob_start(); |
50 | - give_get_template_part( 'history', 'donations' ); |
|
50 | + give_get_template_part('history', 'donations'); |
|
51 | 51 | |
52 | 52 | return ob_get_clean(); |
53 | 53 | |
54 | - } elseif ( give_is_setting_enabled( $email_access ) ) { |
|
54 | + } elseif (give_is_setting_enabled($email_access)) { |
|
55 | 55 | //Is Email-based access enabled? |
56 | 56 | ob_start(); |
57 | - give_get_template_part( 'email', 'login-form' ); |
|
57 | + give_get_template_part('email', 'login-form'); |
|
58 | 58 | |
59 | 59 | return ob_get_clean(); |
60 | 60 | } else { |
61 | 61 | |
62 | - echo apply_filters( 'give_donation_history_nonuser_message', give_output_error( __( 'You must be logged in to view your donation history. Please login using your account or create an account using the same email you used to donate with.', 'give' ), false ) ); |
|
63 | - echo do_shortcode( '[give_login]' ); |
|
62 | + echo apply_filters('give_donation_history_nonuser_message', give_output_error(__('You must be logged in to view your donation history. Please login using your account or create an account using the same email you used to donate with.', 'give'), false)); |
|
63 | + echo do_shortcode('[give_login]'); |
|
64 | 64 | |
65 | 65 | } |
66 | 66 | } |
67 | 67 | |
68 | -add_shortcode( 'donation_history', 'give_donation_history' ); |
|
68 | +add_shortcode('donation_history', 'give_donation_history'); |
|
69 | 69 | |
70 | 70 | /** |
71 | 71 | * Donation Form Shortcode |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | * |
79 | 79 | * @return string |
80 | 80 | */ |
81 | -function give_form_shortcode( $atts ) { |
|
82 | - $atts = shortcode_atts( array( |
|
81 | +function give_form_shortcode($atts) { |
|
82 | + $atts = shortcode_atts(array( |
|
83 | 83 | 'id' => '', |
84 | 84 | 'show_title' => true, |
85 | 85 | 'show_goal' => true, |
@@ -87,21 +87,21 @@ discard block |
||
87 | 87 | 'float_labels' => '', |
88 | 88 | 'display_style' => '', |
89 | 89 | 'continue_button_title' => '', |
90 | - ), $atts, 'give_form' ); |
|
90 | + ), $atts, 'give_form'); |
|
91 | 91 | |
92 | 92 | // Convert string to bool. |
93 | - $atts['show_title'] = filter_var( $atts['show_title'], FILTER_VALIDATE_BOOLEAN ); |
|
94 | - $atts['show_goal'] = filter_var( $atts['show_goal'], FILTER_VALIDATE_BOOLEAN ); |
|
93 | + $atts['show_title'] = filter_var($atts['show_title'], FILTER_VALIDATE_BOOLEAN); |
|
94 | + $atts['show_goal'] = filter_var($atts['show_goal'], FILTER_VALIDATE_BOOLEAN); |
|
95 | 95 | |
96 | 96 | //get the Give Form |
97 | 97 | ob_start(); |
98 | - give_get_donation_form( $atts ); |
|
98 | + give_get_donation_form($atts); |
|
99 | 99 | $final_output = ob_get_clean(); |
100 | 100 | |
101 | - return apply_filters( 'give_donate_form', $final_output, $atts ); |
|
101 | + return apply_filters('give_donate_form', $final_output, $atts); |
|
102 | 102 | } |
103 | 103 | |
104 | -add_shortcode( 'give_form', 'give_form_shortcode' ); |
|
104 | +add_shortcode('give_form', 'give_form_shortcode'); |
|
105 | 105 | |
106 | 106 | /** |
107 | 107 | * Donation Form Goal Shortcode. |
@@ -114,37 +114,37 @@ discard block |
||
114 | 114 | * |
115 | 115 | * @return string |
116 | 116 | */ |
117 | -function give_goal_shortcode( $atts ) { |
|
118 | - $atts = shortcode_atts( array( |
|
117 | +function give_goal_shortcode($atts) { |
|
118 | + $atts = shortcode_atts(array( |
|
119 | 119 | 'id' => '', |
120 | 120 | 'show_text' => true, |
121 | 121 | 'show_bar' => true, |
122 | - ), $atts, 'give_goal' ); |
|
122 | + ), $atts, 'give_goal'); |
|
123 | 123 | |
124 | 124 | |
125 | 125 | //get the Give Form. |
126 | 126 | ob_start(); |
127 | 127 | |
128 | 128 | //Sanity check 1: ensure there is an ID Provided. |
129 | - if ( empty( $atts['id'] ) ) { |
|
130 | - give_output_error( esc_html__( 'The shortcode is missing Donation Form ID attribute.', 'give' ), true ); |
|
129 | + if (empty($atts['id'])) { |
|
130 | + give_output_error(esc_html__('The shortcode is missing Donation Form ID attribute.', 'give'), true); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | //Sanity check 2: Check the form even has Goals enabled. |
134 | - if ( ! give_is_setting_enabled( get_post_meta( $atts['id'], '_give_goal_option', true ) ) ) { |
|
134 | + if ( ! give_is_setting_enabled(get_post_meta($atts['id'], '_give_goal_option', true))) { |
|
135 | 135 | |
136 | - give_output_error( esc_html__( 'The form does not have Goals enabled.', 'give' ), true ); |
|
136 | + give_output_error(esc_html__('The form does not have Goals enabled.', 'give'), true); |
|
137 | 137 | } else { |
138 | 138 | //Passed all sanity checks: output Goal. |
139 | - give_show_goal_progress( $atts['id'], $atts ); |
|
139 | + give_show_goal_progress($atts['id'], $atts); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | $final_output = ob_get_clean(); |
143 | 143 | |
144 | - return apply_filters( 'give_goal_shortcode_output', $final_output, $atts ); |
|
144 | + return apply_filters('give_goal_shortcode_output', $final_output, $atts); |
|
145 | 145 | } |
146 | 146 | |
147 | -add_shortcode( 'give_goal', 'give_goal_shortcode' ); |
|
147 | +add_shortcode('give_goal', 'give_goal_shortcode'); |
|
148 | 148 | |
149 | 149 | |
150 | 150 | /** |
@@ -161,22 +161,22 @@ discard block |
||
161 | 161 | * |
162 | 162 | * @return string |
163 | 163 | */ |
164 | -function give_login_form_shortcode( $atts ) { |
|
165 | - $atts = shortcode_atts( array( |
|
164 | +function give_login_form_shortcode($atts) { |
|
165 | + $atts = shortcode_atts(array( |
|
166 | 166 | // Add backward compatibility for redirect attribute. |
167 | 167 | 'redirect' => '', |
168 | 168 | |
169 | 169 | 'login-redirect' => '', |
170 | 170 | 'logout-redirect' => '', |
171 | - ), $atts, 'give_login' ); |
|
171 | + ), $atts, 'give_login'); |
|
172 | 172 | |
173 | 173 | // Check login-redirect attribute first, if it empty or not found then check for redirect attribute and add value of this to login-redirect attribute. |
174 | - $atts['login-redirect'] = ! empty( $atts['login-redirect'] ) ? $atts['login-redirect'] : ( ! empty( $atts['redirect'] ) ? $atts['redirect'] : '' ); |
|
174 | + $atts['login-redirect'] = ! empty($atts['login-redirect']) ? $atts['login-redirect'] : ( ! empty($atts['redirect']) ? $atts['redirect'] : ''); |
|
175 | 175 | |
176 | - return give_login_form( $atts['login-redirect'], $atts['logout-redirect'] ); |
|
176 | + return give_login_form($atts['login-redirect'], $atts['logout-redirect']); |
|
177 | 177 | } |
178 | 178 | |
179 | -add_shortcode( 'give_login', 'give_login_form_shortcode' ); |
|
179 | +add_shortcode('give_login', 'give_login_form_shortcode'); |
|
180 | 180 | |
181 | 181 | /** |
182 | 182 | * Register Shortcode. |
@@ -191,15 +191,15 @@ discard block |
||
191 | 191 | * |
192 | 192 | * @return string |
193 | 193 | */ |
194 | -function give_register_form_shortcode( $atts ) { |
|
195 | - $atts = shortcode_atts( array( |
|
194 | +function give_register_form_shortcode($atts) { |
|
195 | + $atts = shortcode_atts(array( |
|
196 | 196 | 'redirect' => '', |
197 | - ), $atts, 'give_register' ); |
|
197 | + ), $atts, 'give_register'); |
|
198 | 198 | |
199 | - return give_register_form( $atts['redirect'] ); |
|
199 | + return give_register_form($atts['redirect']); |
|
200 | 200 | } |
201 | 201 | |
202 | -add_shortcode( 'give_register', 'give_register_form_shortcode' ); |
|
202 | +add_shortcode('give_register', 'give_register_form_shortcode'); |
|
203 | 203 | |
204 | 204 | /** |
205 | 205 | * Receipt Shortcode. |
@@ -212,12 +212,12 @@ discard block |
||
212 | 212 | * |
213 | 213 | * @return string |
214 | 214 | */ |
215 | -function give_receipt_shortcode( $atts ) { |
|
215 | +function give_receipt_shortcode($atts) { |
|
216 | 216 | |
217 | 217 | global $give_receipt_args, $payment; |
218 | 218 | |
219 | - $give_receipt_args = shortcode_atts( array( |
|
220 | - 'error' => esc_html__( 'You are missing the payment key to view this donation receipt.', 'give' ), |
|
219 | + $give_receipt_args = shortcode_atts(array( |
|
220 | + 'error' => esc_html__('You are missing the payment key to view this donation receipt.', 'give'), |
|
221 | 221 | 'price' => true, |
222 | 222 | 'donor' => true, |
223 | 223 | 'date' => true, |
@@ -226,50 +226,50 @@ discard block |
||
226 | 226 | 'payment_id' => true, |
227 | 227 | 'payment_status' => false, |
228 | 228 | 'status_notice' => true, |
229 | - ), $atts, 'give_receipt' ); |
|
229 | + ), $atts, 'give_receipt'); |
|
230 | 230 | |
231 | 231 | //set $session var |
232 | 232 | $session = give_get_purchase_session(); |
233 | 233 | |
234 | 234 | //set payment key var |
235 | - if ( isset( $_GET['payment_key'] ) ) { |
|
236 | - $payment_key = urldecode( $_GET['payment_key'] ); |
|
237 | - } elseif ( $session ) { |
|
235 | + if (isset($_GET['payment_key'])) { |
|
236 | + $payment_key = urldecode($_GET['payment_key']); |
|
237 | + } elseif ($session) { |
|
238 | 238 | $payment_key = $session['purchase_key']; |
239 | - } elseif ( $give_receipt_args['payment_key'] ) { |
|
239 | + } elseif ($give_receipt_args['payment_key']) { |
|
240 | 240 | $payment_key = $give_receipt_args['payment_key']; |
241 | 241 | } |
242 | 242 | |
243 | - $email_access = give_get_option( 'email_access' ); |
|
243 | + $email_access = give_get_option('email_access'); |
|
244 | 244 | |
245 | 245 | // No payment_key found & Email Access is Turned on: |
246 | - if ( ! isset( $payment_key ) && give_is_setting_enabled( $email_access ) && ! Give()->email_access->token_exists ) { |
|
246 | + if ( ! isset($payment_key) && give_is_setting_enabled($email_access) && ! Give()->email_access->token_exists) { |
|
247 | 247 | |
248 | 248 | ob_start(); |
249 | 249 | |
250 | - give_get_template_part( 'email-login-form' ); |
|
250 | + give_get_template_part('email-login-form'); |
|
251 | 251 | |
252 | 252 | return ob_get_clean(); |
253 | 253 | |
254 | - } elseif ( ! isset( $payment_key ) ) { |
|
254 | + } elseif ( ! isset($payment_key)) { |
|
255 | 255 | |
256 | - return give_output_error( $give_receipt_args['error'], false, 'error' ); |
|
256 | + return give_output_error($give_receipt_args['error'], false, 'error'); |
|
257 | 257 | |
258 | 258 | } |
259 | 259 | |
260 | - $payment_id = give_get_purchase_id_by_key( $payment_key ); |
|
261 | - $user_can_view = give_can_view_receipt( $payment_key ); |
|
260 | + $payment_id = give_get_purchase_id_by_key($payment_key); |
|
261 | + $user_can_view = give_can_view_receipt($payment_key); |
|
262 | 262 | |
263 | 263 | // Key was provided, but user is logged out. Offer them the ability to login and view the receipt. |
264 | - if ( ! $user_can_view && give_is_setting_enabled( $email_access ) && ! Give()->email_access->token_exists ) { |
|
264 | + if ( ! $user_can_view && give_is_setting_enabled($email_access) && ! Give()->email_access->token_exists) { |
|
265 | 265 | |
266 | 266 | ob_start(); |
267 | 267 | |
268 | - give_get_template_part( 'email-login-form' ); |
|
268 | + give_get_template_part('email-login-form'); |
|
269 | 269 | |
270 | 270 | return ob_get_clean(); |
271 | 271 | |
272 | - } elseif ( ! $user_can_view ) { |
|
272 | + } elseif ( ! $user_can_view) { |
|
273 | 273 | |
274 | 274 | global $give_login_redirect; |
275 | 275 | |
@@ -277,9 +277,9 @@ discard block |
||
277 | 277 | |
278 | 278 | ob_start(); |
279 | 279 | |
280 | - give_output_error( apply_filters( 'give_must_be_logged_in_error_message', esc_html__( 'You must be logged in to view this donation receipt.', 'give' ) ) ); |
|
280 | + give_output_error(apply_filters('give_must_be_logged_in_error_message', esc_html__('You must be logged in to view this donation receipt.', 'give'))); |
|
281 | 281 | |
282 | - give_get_template_part( 'shortcode', 'login' ); |
|
282 | + give_get_template_part('shortcode', 'login'); |
|
283 | 283 | |
284 | 284 | $login_form = ob_get_clean(); |
285 | 285 | |
@@ -294,20 +294,20 @@ discard block |
||
294 | 294 | * or if user is logged in and the user can view sensitive shop data. |
295 | 295 | * |
296 | 296 | */ |
297 | - if ( ! apply_filters( 'give_user_can_view_receipt', $user_can_view, $give_receipt_args ) ) { |
|
298 | - return give_output_error( $give_receipt_args['error'], false, 'error' ); |
|
297 | + if ( ! apply_filters('give_user_can_view_receipt', $user_can_view, $give_receipt_args)) { |
|
298 | + return give_output_error($give_receipt_args['error'], false, 'error'); |
|
299 | 299 | } |
300 | 300 | |
301 | 301 | ob_start(); |
302 | 302 | |
303 | - give_get_template_part( 'shortcode', 'receipt' ); |
|
303 | + give_get_template_part('shortcode', 'receipt'); |
|
304 | 304 | |
305 | 305 | $display = ob_get_clean(); |
306 | 306 | |
307 | 307 | return $display; |
308 | 308 | } |
309 | 309 | |
310 | -add_shortcode( 'give_receipt', 'give_receipt_shortcode' ); |
|
310 | +add_shortcode('give_receipt', 'give_receipt_shortcode'); |
|
311 | 311 | |
312 | 312 | /** |
313 | 313 | * Profile Editor Shortcode. |
@@ -326,18 +326,18 @@ discard block |
||
326 | 326 | * |
327 | 327 | * @return string Output generated from the profile editor |
328 | 328 | */ |
329 | -function give_profile_editor_shortcode( $atts ) { |
|
329 | +function give_profile_editor_shortcode($atts) { |
|
330 | 330 | |
331 | 331 | ob_start(); |
332 | 332 | |
333 | - give_get_template_part( 'shortcode', 'profile-editor' ); |
|
333 | + give_get_template_part('shortcode', 'profile-editor'); |
|
334 | 334 | |
335 | 335 | $display = ob_get_clean(); |
336 | 336 | |
337 | 337 | return $display; |
338 | 338 | } |
339 | 339 | |
340 | -add_shortcode( 'give_profile_editor', 'give_profile_editor_shortcode' ); |
|
340 | +add_shortcode('give_profile_editor', 'give_profile_editor_shortcode'); |
|
341 | 341 | |
342 | 342 | /** |
343 | 343 | * Process Profile Updater Form. |
@@ -350,30 +350,30 @@ discard block |
||
350 | 350 | * |
351 | 351 | * @return bool |
352 | 352 | */ |
353 | -function give_process_profile_editor_updates( $data ) { |
|
353 | +function give_process_profile_editor_updates($data) { |
|
354 | 354 | // Profile field change request |
355 | - if ( empty( $_POST['give_profile_editor_submit'] ) && ! is_user_logged_in() ) { |
|
355 | + if (empty($_POST['give_profile_editor_submit']) && ! is_user_logged_in()) { |
|
356 | 356 | return false; |
357 | 357 | } |
358 | 358 | |
359 | 359 | // Nonce security |
360 | - if ( ! wp_verify_nonce( $data['give_profile_editor_nonce'], 'give-profile-editor-nonce' ) ) { |
|
360 | + if ( ! wp_verify_nonce($data['give_profile_editor_nonce'], 'give-profile-editor-nonce')) { |
|
361 | 361 | return false; |
362 | 362 | } |
363 | 363 | |
364 | 364 | $user_id = get_current_user_id(); |
365 | - $old_user_data = get_userdata( $user_id ); |
|
366 | - |
|
367 | - $display_name = isset( $data['give_display_name'] ) ? sanitize_text_field( $data['give_display_name'] ) : $old_user_data->display_name; |
|
368 | - $first_name = isset( $data['give_first_name'] ) ? sanitize_text_field( $data['give_first_name'] ) : $old_user_data->first_name; |
|
369 | - $last_name = isset( $data['give_last_name'] ) ? sanitize_text_field( $data['give_last_name'] ) : $old_user_data->last_name; |
|
370 | - $email = isset( $data['give_email'] ) ? sanitize_email( $data['give_email'] ) : $old_user_data->user_email; |
|
371 | - $line1 = ( isset( $data['give_address_line1'] ) ? sanitize_text_field( $data['give_address_line1'] ) : '' ); |
|
372 | - $line2 = ( isset( $data['give_address_line2'] ) ? sanitize_text_field( $data['give_address_line2'] ) : '' ); |
|
373 | - $city = ( isset( $data['give_address_city'] ) ? sanitize_text_field( $data['give_address_city'] ) : '' ); |
|
374 | - $state = ( isset( $data['give_address_state'] ) ? sanitize_text_field( $data['give_address_state'] ) : '' ); |
|
375 | - $zip = ( isset( $data['give_address_zip'] ) ? sanitize_text_field( $data['give_address_zip'] ) : '' ); |
|
376 | - $country = ( isset( $data['give_address_country'] ) ? sanitize_text_field( $data['give_address_country'] ) : '' ); |
|
365 | + $old_user_data = get_userdata($user_id); |
|
366 | + |
|
367 | + $display_name = isset($data['give_display_name']) ? sanitize_text_field($data['give_display_name']) : $old_user_data->display_name; |
|
368 | + $first_name = isset($data['give_first_name']) ? sanitize_text_field($data['give_first_name']) : $old_user_data->first_name; |
|
369 | + $last_name = isset($data['give_last_name']) ? sanitize_text_field($data['give_last_name']) : $old_user_data->last_name; |
|
370 | + $email = isset($data['give_email']) ? sanitize_email($data['give_email']) : $old_user_data->user_email; |
|
371 | + $line1 = (isset($data['give_address_line1']) ? sanitize_text_field($data['give_address_line1']) : ''); |
|
372 | + $line2 = (isset($data['give_address_line2']) ? sanitize_text_field($data['give_address_line2']) : ''); |
|
373 | + $city = (isset($data['give_address_city']) ? sanitize_text_field($data['give_address_city']) : ''); |
|
374 | + $state = (isset($data['give_address_state']) ? sanitize_text_field($data['give_address_state']) : ''); |
|
375 | + $zip = (isset($data['give_address_zip']) ? sanitize_text_field($data['give_address_zip']) : ''); |
|
376 | + $country = (isset($data['give_address_country']) ? sanitize_text_field($data['give_address_country']) : ''); |
|
377 | 377 | |
378 | 378 | $userdata = array( |
379 | 379 | 'ID' => $user_id, |
@@ -401,46 +401,46 @@ discard block |
||
401 | 401 | * @param int $user_id The ID of the user. |
402 | 402 | * @param array $userdata User info, including ID, first name, last name, display name and email. |
403 | 403 | */ |
404 | - do_action( 'give_pre_update_user_profile', $user_id, $userdata ); |
|
404 | + do_action('give_pre_update_user_profile', $user_id, $userdata); |
|
405 | 405 | |
406 | 406 | // New password |
407 | - if ( ! empty( $data['give_new_user_pass1'] ) ) { |
|
408 | - if ( $data['give_new_user_pass1'] !== $data['give_new_user_pass2'] ) { |
|
409 | - give_set_error( 'password_mismatch', esc_html__( 'The passwords you entered do not match. Please try again.', 'give' ) ); |
|
407 | + if ( ! empty($data['give_new_user_pass1'])) { |
|
408 | + if ($data['give_new_user_pass1'] !== $data['give_new_user_pass2']) { |
|
409 | + give_set_error('password_mismatch', esc_html__('The passwords you entered do not match. Please try again.', 'give')); |
|
410 | 410 | } else { |
411 | 411 | $userdata['user_pass'] = $data['give_new_user_pass1']; |
412 | 412 | } |
413 | 413 | } |
414 | 414 | |
415 | - if ( empty( $email ) ) { |
|
415 | + if (empty($email)) { |
|
416 | 416 | // Make sure email should not be empty. |
417 | - give_set_error( 'email_empty', esc_html__( 'The email you entered is empty.', 'give' ) ); |
|
417 | + give_set_error('email_empty', esc_html__('The email you entered is empty.', 'give')); |
|
418 | 418 | |
419 | - } else if ( ! is_email( $email ) ) { |
|
419 | + } else if ( ! is_email($email)) { |
|
420 | 420 | // Make sure email should be valid. |
421 | - give_set_error( 'email_not_valid', esc_html__( 'The email you entered is not valid. Please use another', 'give' ) ); |
|
421 | + give_set_error('email_not_valid', esc_html__('The email you entered is not valid. Please use another', 'give')); |
|
422 | 422 | |
423 | - } else if ( $email != $old_user_data->user_email ) { |
|
423 | + } else if ($email != $old_user_data->user_email) { |
|
424 | 424 | // Make sure the new email doesn't belong to another user |
425 | - if ( email_exists( $email ) ) { |
|
426 | - give_set_error( 'email_exists', esc_html__( 'The email you entered belongs to another user. Please use another.', 'give' ) ); |
|
425 | + if (email_exists($email)) { |
|
426 | + give_set_error('email_exists', esc_html__('The email you entered belongs to another user. Please use another.', 'give')); |
|
427 | 427 | } |
428 | 428 | } |
429 | 429 | |
430 | 430 | // Check for errors |
431 | 431 | $errors = give_get_errors(); |
432 | 432 | |
433 | - if ( $errors ) { |
|
433 | + if ($errors) { |
|
434 | 434 | // Send back to the profile editor if there are errors |
435 | - wp_redirect( $data['give_redirect'] ); |
|
435 | + wp_redirect($data['give_redirect']); |
|
436 | 436 | give_die(); |
437 | 437 | } |
438 | 438 | |
439 | 439 | // Update the user |
440 | - $meta = update_user_meta( $user_id, '_give_user_address', $address ); |
|
441 | - $updated = wp_update_user( $userdata ); |
|
440 | + $meta = update_user_meta($user_id, '_give_user_address', $address); |
|
441 | + $updated = wp_update_user($userdata); |
|
442 | 442 | |
443 | - if ( $updated ) { |
|
443 | + if ($updated) { |
|
444 | 444 | |
445 | 445 | /** |
446 | 446 | * Fires after updating user profile. |
@@ -450,12 +450,12 @@ discard block |
||
450 | 450 | * @param int $user_id The ID of the user. |
451 | 451 | * @param array $userdata User info, including ID, first name, last name, display name and email. |
452 | 452 | */ |
453 | - do_action( 'give_user_profile_updated', $user_id, $userdata ); |
|
454 | - wp_redirect( add_query_arg( 'updated', 'true', $data['give_redirect'] ) ); |
|
453 | + do_action('give_user_profile_updated', $user_id, $userdata); |
|
454 | + wp_redirect(add_query_arg('updated', 'true', $data['give_redirect'])); |
|
455 | 455 | give_die(); |
456 | 456 | } |
457 | 457 | |
458 | 458 | return false; |
459 | 459 | } |
460 | 460 | |
461 | -add_action( 'give_edit_user_profile', 'give_process_profile_editor_updates' ); |
|
461 | +add_action('give_edit_user_profile', 'give_process_profile_editor_updates'); |
@@ -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,76 +221,76 @@ 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' ); |
|
258 | - wp_enqueue_style( 'wp-color-picker' ); |
|
251 | + wp_register_style('jquery-ui-css', $css_dir.'jquery-ui-fresh'.$suffix.'.css'); |
|
252 | + wp_enqueue_style('jquery-ui-css'); |
|
253 | + wp_register_style('give-admin', $css_dir.'give-admin'.$direction.$suffix.'.css', array(), GIVE_VERSION); |
|
254 | + wp_enqueue_style('give-admin'); |
|
255 | + wp_register_style('jquery-chosen', $css_dir.'chosen'.$suffix.'.css', array(), GIVE_VERSION); |
|
256 | + wp_enqueue_style('jquery-chosen'); |
|
257 | + wp_enqueue_style('thickbox'); |
|
258 | + wp_enqueue_style('wp-color-picker'); |
|
259 | 259 | |
260 | 260 | |
261 | 261 | // JS. |
262 | - wp_register_script( 'jquery-chosen', $js_plugins . 'chosen.jquery' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION ); |
|
263 | - wp_enqueue_script( 'jquery-chosen' ); |
|
262 | + wp_register_script('jquery-chosen', $js_plugins.'chosen.jquery'.$suffix.'.js', array('jquery'), GIVE_VERSION); |
|
263 | + wp_enqueue_script('jquery-chosen'); |
|
264 | 264 | |
265 | - wp_register_script( 'give-accounting', $js_plugins . 'accounting' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
266 | - wp_enqueue_script( 'give-accounting' ); |
|
265 | + wp_register_script('give-accounting', $js_plugins.'accounting'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
266 | + wp_enqueue_script('give-accounting'); |
|
267 | 267 | |
268 | - wp_enqueue_script( 'wp-color-picker' ); |
|
269 | - wp_enqueue_script( 'jquery-ui-datepicker' ); |
|
270 | - wp_enqueue_script( 'thickbox' ); |
|
268 | + wp_enqueue_script('wp-color-picker'); |
|
269 | + wp_enqueue_script('jquery-ui-datepicker'); |
|
270 | + wp_enqueue_script('thickbox'); |
|
271 | 271 | |
272 | - wp_register_script( 'give-admin-scripts', $js_dir . 'admin-scripts' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker', 'wp-color-picker' ), GIVE_VERSION, false ); |
|
273 | - wp_enqueue_script( 'give-admin-scripts' ); |
|
272 | + wp_register_script('give-admin-scripts', $js_dir.'admin-scripts'.$suffix.'.js', array('jquery', 'jquery-ui-datepicker', 'wp-color-picker'), GIVE_VERSION, false); |
|
273 | + wp_enqueue_script('give-admin-scripts'); |
|
274 | 274 | |
275 | - wp_register_script( 'jquery-flot', $js_plugins . 'jquery.flot' . $suffix . '.js' ); |
|
276 | - wp_enqueue_script( 'jquery-flot' ); |
|
275 | + wp_register_script('jquery-flot', $js_plugins.'jquery.flot'.$suffix.'.js'); |
|
276 | + wp_enqueue_script('jquery-flot'); |
|
277 | 277 | |
278 | - wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
279 | - wp_enqueue_script( 'give-qtip' ); |
|
278 | + wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
279 | + wp_enqueue_script('give-qtip'); |
|
280 | 280 | |
281 | - wp_register_script( 'give-repeatable-fields', $js_plugins . 'repeatable-fields' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
282 | - wp_enqueue_script( 'give-repeatable-fields' ); |
|
281 | + wp_register_script('give-repeatable-fields', $js_plugins.'repeatable-fields'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
282 | + wp_enqueue_script('give-repeatable-fields'); |
|
283 | 283 | |
284 | 284 | // Forms CPT Script. |
285 | - if ( $post_type === 'give_forms' ) { |
|
286 | - wp_register_script( 'give-admin-forms-scripts', $js_dir . 'admin-forms' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
287 | - wp_enqueue_script( 'give-admin-forms-scripts' ); |
|
285 | + if ($post_type === 'give_forms') { |
|
286 | + wp_register_script('give-admin-forms-scripts', $js_dir.'admin-forms'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
287 | + wp_enqueue_script('give-admin-forms-scripts'); |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | // Settings Scripts. |
291 | - if ( isset( $_GET['page'] ) && $_GET['page'] == 'give-settings' ) { |
|
292 | - wp_register_script( 'give-admin-settings-scripts', $js_dir . 'admin-settings' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
293 | - wp_enqueue_script( 'give-admin-settings-scripts' ); |
|
291 | + if (isset($_GET['page']) && $_GET['page'] == 'give-settings') { |
|
292 | + wp_register_script('give-admin-settings-scripts', $js_dir.'admin-settings'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
293 | + wp_enqueue_script('give-admin-settings-scripts'); |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | // Price Separators. |
@@ -298,59 +298,59 @@ discard block |
||
298 | 298 | $decimal_separator = give_get_price_decimal_separator(); |
299 | 299 | |
300 | 300 | // Localize strings & variables for JS. |
301 | - wp_localize_script( 'give-admin-scripts', 'give_vars', array( |
|
302 | - 'post_id' => isset( $post->ID ) ? $post->ID : null, |
|
301 | + wp_localize_script('give-admin-scripts', 'give_vars', array( |
|
302 | + 'post_id' => isset($post->ID) ? $post->ID : null, |
|
303 | 303 | 'give_version' => GIVE_VERSION, |
304 | 304 | 'thousands_separator' => $thousand_separator, |
305 | 305 | 'decimal_separator' => $decimal_separator, |
306 | - 'quick_edit_warning' => __( 'Not available for variable priced forms.', 'give' ), |
|
307 | - 'delete_payment' => __( 'Are you sure you wish to delete this payment?', 'give' ), |
|
308 | - 'delete_payment_note' => __( 'Are you sure you wish to delete this note?', 'give' ), |
|
309 | - 'revoke_api_key' => __( 'Are you sure you wish to revoke this API key?', 'give' ), |
|
310 | - 'regenerate_api_key' => __( 'Are you sure you wish to regenerate this API key?', 'give' ), |
|
311 | - 'resend_receipt' => __( 'Are you sure you wish to resend the donation receipt?', 'give' ), |
|
312 | - 'logo' => __( 'Logo', 'give' ), |
|
313 | - 'use_this_image' => __( 'Use this image', 'give' ), |
|
314 | - 'one_option' => __( 'Choose a form', 'give' ), |
|
315 | - 'one_or_more_option' => __( 'Choose one or more forms', 'give' ), |
|
316 | - 'currency_sign' => give_currency_filter( '' ), |
|
317 | - 'currency_pos' => isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before', |
|
318 | - 'currency_decimals' => give_currency_decimal_filter( give_get_price_decimals() ), |
|
319 | - 'batch_export_no_class' => __( 'You must choose a method.', 'give' ), |
|
320 | - 'batch_export_no_reqs' => __( 'Required fields not completed.', 'give' ), |
|
321 | - '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' ), |
|
322 | - 'price_format_guide' => sprintf( __( 'Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give' ), $decimal_separator, $thousand_separator ), |
|
306 | + 'quick_edit_warning' => __('Not available for variable priced forms.', 'give'), |
|
307 | + 'delete_payment' => __('Are you sure you wish to delete this payment?', 'give'), |
|
308 | + 'delete_payment_note' => __('Are you sure you wish to delete this note?', 'give'), |
|
309 | + 'revoke_api_key' => __('Are you sure you wish to revoke this API key?', 'give'), |
|
310 | + 'regenerate_api_key' => __('Are you sure you wish to regenerate this API key?', 'give'), |
|
311 | + 'resend_receipt' => __('Are you sure you wish to resend the donation receipt?', 'give'), |
|
312 | + 'logo' => __('Logo', 'give'), |
|
313 | + 'use_this_image' => __('Use this image', 'give'), |
|
314 | + 'one_option' => __('Choose a form', 'give'), |
|
315 | + 'one_or_more_option' => __('Choose one or more forms', 'give'), |
|
316 | + 'currency_sign' => give_currency_filter(''), |
|
317 | + 'currency_pos' => isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before', |
|
318 | + 'currency_decimals' => give_currency_decimal_filter(give_get_price_decimals()), |
|
319 | + 'batch_export_no_class' => __('You must choose a method.', 'give'), |
|
320 | + 'batch_export_no_reqs' => __('Required fields not completed.', 'give'), |
|
321 | + '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'), |
|
322 | + 'price_format_guide' => sprintf(__('Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give'), $decimal_separator, $thousand_separator), |
|
323 | 323 | /* translators : %s: Donation form options metabox */ |
324 | - 'confirm_before_remove_row_text' => __( 'Do you want to delete this level?', 'give' ), |
|
325 | - 'matched_success_failure_page' => __( 'You cannot set the success and failed pages to the same page', 'give' ), |
|
326 | - 'dismiss_notice_text' => __( 'Dismiss this notice.', 'give' ), |
|
324 | + 'confirm_before_remove_row_text' => __('Do you want to delete this level?', 'give'), |
|
325 | + 'matched_success_failure_page' => __('You cannot set the success and failed pages to the same page', 'give'), |
|
326 | + 'dismiss_notice_text' => __('Dismiss this notice.', 'give'), |
|
327 | 327 | 'bulk_action' => array( |
328 | 328 | 'delete' => array( |
329 | - 'zero_payment_selected' => __( 'You must choose at least one or more payments to delete.', 'give' ), |
|
330 | - 'delete_payment' => __( 'Are you sure you want to permanently delete this donation?', 'give' ), |
|
331 | - 'delete_payments' => __( 'Are you sure you want to permanently delete the selected {payment_count} donations?', 'give' ), |
|
329 | + 'zero_payment_selected' => __('You must choose at least one or more payments to delete.', 'give'), |
|
330 | + 'delete_payment' => __('Are you sure you want to permanently delete this donation?', 'give'), |
|
331 | + 'delete_payments' => __('Are you sure you want to permanently delete the selected {payment_count} donations?', 'give'), |
|
332 | 332 | ), |
333 | 333 | 'resend_receipt' => array( |
334 | - 'zero_recipient_selected' => __( 'You must choose at least one or more recipients to resend the email receipt.', 'give' ), |
|
335 | - 'resend_receipt' => __( 'Are you sure you want to resend the email receipt to this recipient?', 'give' ), |
|
336 | - 'resend_receipts' => __( 'Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give' ), |
|
334 | + 'zero_recipient_selected' => __('You must choose at least one or more recipients to resend the email receipt.', 'give'), |
|
335 | + 'resend_receipt' => __('Are you sure you want to resend the email receipt to this recipient?', 'give'), |
|
336 | + 'resend_receipts' => __('Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give'), |
|
337 | 337 | ), |
338 | 338 | ), |
339 | 339 | 'metabox_fields' => array( |
340 | 340 | 'media' => array( |
341 | - 'button_title' => esc_html__( 'Choose Attachment', 'give' ), |
|
341 | + 'button_title' => esc_html__('Choose Attachment', 'give'), |
|
342 | 342 | ) |
343 | 343 | ) |
344 | - ) ); |
|
344 | + )); |
|
345 | 345 | |
346 | - if ( function_exists( 'wp_enqueue_media' ) && version_compare( get_bloginfo( 'version' ), '3.5', '>=' ) ) { |
|
346 | + if (function_exists('wp_enqueue_media') && version_compare(get_bloginfo('version'), '3.5', '>=')) { |
|
347 | 347 | // call for new media manager. |
348 | 348 | wp_enqueue_media(); |
349 | 349 | } |
350 | 350 | |
351 | 351 | } |
352 | 352 | |
353 | -add_action( 'admin_enqueue_scripts', 'give_load_admin_scripts', 100 ); |
|
353 | +add_action('admin_enqueue_scripts', 'give_load_admin_scripts', 100); |
|
354 | 354 | |
355 | 355 | /** |
356 | 356 | * Admin Give Icon |
@@ -365,13 +365,13 @@ discard block |
||
365 | 365 | ?> |
366 | 366 | <style type="text/css" media="screen"> |
367 | 367 | |
368 | - <?php if ( version_compare( get_bloginfo( 'version' ), '3.8-RC', '>=' ) || version_compare( get_bloginfo( 'version' ), '3.8', '>=' ) ) { ?> |
|
368 | + <?php if (version_compare(get_bloginfo('version'), '3.8-RC', '>=') || version_compare(get_bloginfo('version'), '3.8', '>=')) { ?> |
|
369 | 369 | @font-face { |
370 | 370 | font-family: 'give-icomoon'; |
371 | - src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?ngjl88'; ?>'); |
|
372 | - src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'), |
|
373 | - url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.woff?ngjl88'; ?>') format('woff'), |
|
374 | - url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg'); |
|
371 | + src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?ngjl88'; ?>'); |
|
372 | + src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'), |
|
373 | + url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.woff?ngjl88'; ?>') format('woff'), |
|
374 | + url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg'); |
|
375 | 375 | font-weight: normal; |
376 | 376 | font-style: normal; |
377 | 377 | } |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | <?php |
391 | 391 | } |
392 | 392 | |
393 | -add_action( 'admin_head', 'give_admin_icon' ); |
|
393 | +add_action('admin_head', 'give_admin_icon'); |
|
394 | 394 | |
395 | 395 | /** |
396 | 396 | * Admin js code |
@@ -420,4 +420,4 @@ discard block |
||
420 | 420 | <?php |
421 | 421 | } |
422 | 422 | |
423 | -add_action( 'admin_head', 'give_admin_hide_notice_shortly_js' ); |
|
423 | +add_action('admin_head', 'give_admin_hide_notice_shortly_js'); |
@@ -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 | |
@@ -20,27 +20,27 @@ discard block |
||
20 | 20 | * @since 1.0 |
21 | 21 | * @return void |
22 | 22 | */ |
23 | -if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { |
|
24 | - wp_die( esc_html__( 'Donation ID not supplied. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) ); |
|
23 | +if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) { |
|
24 | + wp_die(esc_html__('Donation ID not supplied. Please try again.', 'give'), esc_html__('Error', 'give'), array('response' => 400)); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | // Setup the variables |
28 | -$payment_id = absint( $_GET['id'] ); |
|
29 | -$payment = new Give_Payment( $payment_id ); |
|
28 | +$payment_id = absint($_GET['id']); |
|
29 | +$payment = new Give_Payment($payment_id); |
|
30 | 30 | |
31 | 31 | // Sanity check... fail if donation ID is invalid |
32 | 32 | $payment_exists = $payment->ID; |
33 | -if ( empty( $payment_exists ) ) { |
|
34 | - wp_die( esc_html__( 'The specified ID does not belong to a donation. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) ); |
|
33 | +if (empty($payment_exists)) { |
|
34 | + wp_die(esc_html__('The specified ID does not belong to a donation. Please try again.', 'give'), esc_html__('Error', 'give'), array('response' => 400)); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | $number = $payment->number; |
38 | 38 | $payment_meta = $payment->get_meta(); |
39 | -$transaction_id = esc_attr( $payment->transaction_id ); |
|
39 | +$transaction_id = esc_attr($payment->transaction_id); |
|
40 | 40 | $user_id = $payment->user_id; |
41 | 41 | $customer_id = $payment->customer_id; |
42 | -$payment_date = strtotime( $payment->date ); |
|
43 | -$user_info = give_get_payment_meta_user_info( $payment_id ); |
|
42 | +$payment_date = strtotime($payment->date); |
|
43 | +$user_info = give_get_payment_meta_user_info($payment_id); |
|
44 | 44 | $address = $payment->address; |
45 | 45 | $currency_code = $payment->currency; |
46 | 46 | $gateway = $payment->gateway; |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | <h1 id="transaction-details-heading"><?php |
53 | 53 | printf( |
54 | 54 | /* translators: %s: donation number */ |
55 | - esc_html__( 'Donation %s', 'give' ), |
|
55 | + esc_html__('Donation %s', 'give'), |
|
56 | 56 | $number |
57 | 57 | ); |
58 | - if ( $payment_mode == 'test' ) { |
|
59 | - echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="' . esc_attr__( 'This donation was made in test mode.', 'give' ) . '" data-tooltip-my-position="center left" data-tooltip-target-position="center right">' . esc_html__( 'Test Donation', 'give' ) . '</span>'; |
|
58 | + if ($payment_mode == 'test') { |
|
59 | + echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="'.esc_attr__('This donation was made in test mode.', 'give').'" data-tooltip-my-position="center left" data-tooltip-target-position="center right">'.esc_html__('Test Donation', 'give').'</span>'; |
|
60 | 60 | } |
61 | 61 | ?></h1> |
62 | 62 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @param int $payment_id Payment id. |
70 | 70 | */ |
71 | - do_action( 'give_view_order_details_before', $payment_id ); |
|
71 | + do_action('give_view_order_details_before', $payment_id); |
|
72 | 72 | ?> |
73 | 73 | <form id="give-edit-order-form" method="post"> |
74 | 74 | <?php |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * |
80 | 80 | * @param int $payment_id Payment id. |
81 | 81 | */ |
82 | - do_action( 'give_view_order_details_form_top', $payment_id ); |
|
82 | + do_action('give_view_order_details_form_top', $payment_id); |
|
83 | 83 | ?> |
84 | 84 | <div id="poststuff"> |
85 | 85 | <div id="give-dashboard-widgets-wrap"> |
@@ -95,12 +95,12 @@ discard block |
||
95 | 95 | * |
96 | 96 | * @param int $payment_id Payment id. |
97 | 97 | */ |
98 | - do_action( 'give_view_order_details_sidebar_before', $payment_id ); |
|
98 | + do_action('give_view_order_details_sidebar_before', $payment_id); |
|
99 | 99 | ?> |
100 | 100 | |
101 | 101 | <div id="give-order-update" class="postbox give-order-data"> |
102 | 102 | |
103 | - <h3 class="hndle"><?php esc_html_e( 'Update Donation', 'give' ); ?></h3> |
|
103 | + <h3 class="hndle"><?php esc_html_e('Update Donation', 'give'); ?></h3> |
|
104 | 104 | |
105 | 105 | <div class="inside"> |
106 | 106 | <div class="give-admin-box"> |
@@ -113,33 +113,33 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @param int $payment_id Payment id. |
115 | 115 | */ |
116 | - do_action( 'give_view_order_details_totals_before', $payment_id ); |
|
116 | + do_action('give_view_order_details_totals_before', $payment_id); |
|
117 | 117 | ?> |
118 | 118 | |
119 | 119 | <div class="give-admin-box-inside"> |
120 | 120 | <p> |
121 | - <label for="give-payment-status" class="strong"><?php esc_html_e( 'Status:', 'give' ); ?></label> |
|
121 | + <label for="give-payment-status" class="strong"><?php esc_html_e('Status:', 'give'); ?></label> |
|
122 | 122 | <select id="give-payment-status" name="give-payment-status" class="medium-text"> |
123 | - <?php foreach ( give_get_payment_statuses() as $key => $status ) : ?> |
|
124 | - <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $payment->status, $key, true ); ?>><?php echo esc_html( $status ); ?></option> |
|
123 | + <?php foreach (give_get_payment_statuses() as $key => $status) : ?> |
|
124 | + <option value="<?php echo esc_attr($key); ?>"<?php selected($payment->status, $key, true); ?>><?php echo esc_html($status); ?></option> |
|
125 | 125 | <?php endforeach; ?> |
126 | 126 | </select> |
127 | - <span class="give-donation-status status-<?php echo sanitize_title( $payment->status ); ?>"><span class="give-donation-status-icon"></span></span> |
|
127 | + <span class="give-donation-status status-<?php echo sanitize_title($payment->status); ?>"><span class="give-donation-status-icon"></span></span> |
|
128 | 128 | </p> |
129 | 129 | </div> |
130 | 130 | |
131 | 131 | <div class="give-admin-box-inside"> |
132 | 132 | <p> |
133 | - <label for="give-payment-date" class="strong"><?php esc_html_e( 'Date:', 'give' ); ?></label> |
|
134 | - <input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr( date( 'm/d/Y', $payment_date ) ); ?>" class="medium-text give_datepicker"/> |
|
133 | + <label for="give-payment-date" class="strong"><?php esc_html_e('Date:', 'give'); ?></label> |
|
134 | + <input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr(date('m/d/Y', $payment_date)); ?>" class="medium-text give_datepicker"/> |
|
135 | 135 | </p> |
136 | 136 | </div> |
137 | 137 | |
138 | 138 | <div class="give-admin-box-inside"> |
139 | 139 | <p> |
140 | - <label for="give-payment-time-hour" class="strong"><?php esc_html_e( 'Time:', 'give' ); ?></label> |
|
141 | - <input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr( date_i18n( 'H', $payment_date ) ); ?>" class="small-text give-payment-time-hour"/> : |
|
142 | - <input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr( date( 'i', $payment_date ) ); ?>" class="small-text give-payment-time-min"/> |
|
140 | + <label for="give-payment-time-hour" class="strong"><?php esc_html_e('Time:', 'give'); ?></label> |
|
141 | + <input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr(date_i18n('H', $payment_date)); ?>" class="small-text give-payment-time-hour"/> : |
|
142 | + <input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr(date('i', $payment_date)); ?>" class="small-text give-payment-time-min"/> |
|
143 | 143 | </p> |
144 | 144 | </div> |
145 | 145 | |
@@ -153,18 +153,18 @@ discard block |
||
153 | 153 | * |
154 | 154 | * @param int $payment_id Payment id. |
155 | 155 | */ |
156 | - do_action( 'give_view_order_details_update_inner', $payment_id ); |
|
156 | + do_action('give_view_order_details_update_inner', $payment_id); |
|
157 | 157 | |
158 | 158 | // @TODO: Fees |
159 | - $fees = give_get_payment_fees( $payment_id ); |
|
160 | - if ( ! empty( $fees ) ) : ?> |
|
159 | + $fees = give_get_payment_fees($payment_id); |
|
160 | + if ( ! empty($fees)) : ?> |
|
161 | 161 | <div class="give-order-fees give-admin-box-inside"> |
162 | - <p class="strong"><?php esc_html_e( 'Fees:', 'give' ); ?></p> |
|
162 | + <p class="strong"><?php esc_html_e('Fees:', 'give'); ?></p> |
|
163 | 163 | <ul class="give-payment-fees"> |
164 | - <?php foreach ( $fees as $fee ) : ?> |
|
164 | + <?php foreach ($fees as $fee) : ?> |
|
165 | 165 | <li> |
166 | 166 | <span class="fee-label"><?php echo $fee['label']; ?>:</span> |
167 | - <span class="fee-amount" data-fee="<?php echo esc_attr( $fee['amount'] ); ?>"><?php echo give_currency_filter( $fee['amount'], $currency_code ); ?></span> |
|
167 | + <span class="fee-amount" data-fee="<?php echo esc_attr($fee['amount']); ?>"><?php echo give_currency_filter($fee['amount'], $currency_code); ?></span> |
|
168 | 168 | </li> |
169 | 169 | <?php endforeach; ?> |
170 | 170 | </ul> |
@@ -173,9 +173,9 @@ discard block |
||
173 | 173 | |
174 | 174 | <div class="give-order-payment give-admin-box-inside"> |
175 | 175 | <p> |
176 | - <label for="give-payment-total" class="strong"><?php esc_html_e( 'Total Donation:', 'give' ); ?></label> |
|
177 | - <?php echo give_currency_symbol( $payment->currency ); ?> |
|
178 | - <input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr( give_format_decimal( give_get_payment_amount( $payment_id ) ) ); ?>"/> |
|
176 | + <label for="give-payment-total" class="strong"><?php esc_html_e('Total Donation:', 'give'); ?></label> |
|
177 | + <?php echo give_currency_symbol($payment->currency); ?> |
|
178 | + <input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr(give_format_decimal(give_get_payment_amount($payment_id))); ?>"/> |
|
179 | 179 | </p> |
180 | 180 | </div> |
181 | 181 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * |
188 | 188 | * @param int $payment_id Payment id. |
189 | 189 | */ |
190 | - do_action( 'give_view_order_details_totals_after', $payment_id ); |
|
190 | + do_action('give_view_order_details_totals_after', $payment_id); |
|
191 | 191 | ?> |
192 | 192 | |
193 | 193 | </div> |
@@ -205,17 +205,17 @@ discard block |
||
205 | 205 | * |
206 | 206 | * @param int $payment_id Payment id. |
207 | 207 | */ |
208 | - do_action( 'give_view_order_details_update_before', $payment_id ); |
|
208 | + do_action('give_view_order_details_update_before', $payment_id); |
|
209 | 209 | ?> |
210 | 210 | |
211 | 211 | <div id="major-publishing-actions"> |
212 | 212 | <div id="publishing-action"> |
213 | - <input type="submit" class="button button-primary right" value="<?php esc_attr_e( 'Save Donation', 'give' ); ?>"/> |
|
214 | - <?php if ( give_is_payment_complete( $payment_id ) ) : ?> |
|
215 | - <a href="<?php echo esc_url( add_query_arg( array( |
|
213 | + <input type="submit" class="button button-primary right" value="<?php esc_attr_e('Save Donation', 'give'); ?>"/> |
|
214 | + <?php if (give_is_payment_complete($payment_id)) : ?> |
|
215 | + <a href="<?php echo esc_url(add_query_arg(array( |
|
216 | 216 | 'give-action' => 'email_links', |
217 | 217 | 'purchase_id' => $payment_id, |
218 | - ) ) ); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e( 'Resend Receipt', 'give' ); ?></a> |
|
218 | + ))); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e('Resend Receipt', 'give'); ?></a> |
|
219 | 219 | <?php endif; ?> |
220 | 220 | </div> |
221 | 221 | <div class="clear"></div> |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | * |
230 | 230 | * @param int $payment_id Payment id. |
231 | 231 | */ |
232 | - do_action( 'give_view_order_details_update_after', $payment_id ); |
|
232 | + do_action('give_view_order_details_update_after', $payment_id); |
|
233 | 233 | ?> |
234 | 234 | |
235 | 235 | </div> |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | |
241 | 241 | <div id="give-order-details" class="postbox give-order-data"> |
242 | 242 | |
243 | - <h3 class="hndle"><?php esc_html_e( 'Donation Meta', 'give' ); ?></h3> |
|
243 | + <h3 class="hndle"><?php esc_html_e('Donation Meta', 'give'); ?></h3> |
|
244 | 244 | |
245 | 245 | <div class="inside"> |
246 | 246 | <div class="give-admin-box"> |
@@ -253,44 +253,44 @@ discard block |
||
253 | 253 | * |
254 | 254 | * @param int $payment_id Payment id. |
255 | 255 | */ |
256 | - do_action( 'give_view_order_details_payment_meta_before', $payment_id ); |
|
256 | + do_action('give_view_order_details_payment_meta_before', $payment_id); |
|
257 | 257 | |
258 | - $gateway = give_get_payment_gateway( $payment_id ); |
|
259 | - if ( $gateway ) : ?> |
|
258 | + $gateway = give_get_payment_gateway($payment_id); |
|
259 | + if ($gateway) : ?> |
|
260 | 260 | <div class="give-order-gateway give-admin-box-inside"> |
261 | 261 | <p> |
262 | - <strong><?php esc_html_e( 'Gateway:', 'give' ); ?></strong> |
|
263 | - <?php echo give_get_gateway_admin_label( $gateway ); ?> |
|
262 | + <strong><?php esc_html_e('Gateway:', 'give'); ?></strong> |
|
263 | + <?php echo give_get_gateway_admin_label($gateway); ?> |
|
264 | 264 | </p> |
265 | 265 | </div> |
266 | 266 | <?php endif; ?> |
267 | 267 | |
268 | 268 | <div class="give-order-payment-key give-admin-box-inside"> |
269 | 269 | <p> |
270 | - <strong><?php esc_html_e( 'Key:', 'give' ); ?></strong> |
|
271 | - <?php echo give_get_payment_key( $payment_id ); ?> |
|
270 | + <strong><?php esc_html_e('Key:', 'give'); ?></strong> |
|
271 | + <?php echo give_get_payment_key($payment_id); ?> |
|
272 | 272 | </p> |
273 | 273 | </div> |
274 | 274 | |
275 | 275 | <div class="give-order-ip give-admin-box-inside"> |
276 | 276 | <p> |
277 | - <strong><?php esc_html_e( 'IP:', 'give' ); ?></strong> |
|
278 | - <?php echo esc_html( give_get_payment_user_ip( $payment_id ) ); ?> |
|
277 | + <strong><?php esc_html_e('IP:', 'give'); ?></strong> |
|
278 | + <?php echo esc_html(give_get_payment_user_ip($payment_id)); ?> |
|
279 | 279 | </p> |
280 | 280 | </div> |
281 | 281 | |
282 | - <?php if ( $transaction_id ) : ?> |
|
282 | + <?php if ($transaction_id) : ?> |
|
283 | 283 | <div class="give-order-tx-id give-admin-box-inside"> |
284 | 284 | <p> |
285 | - <strong><?php esc_html_e( 'Donation ID:', 'give' ); ?></strong> |
|
286 | - <?php echo apply_filters( "give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id ); ?> |
|
285 | + <strong><?php esc_html_e('Donation ID:', 'give'); ?></strong> |
|
286 | + <?php echo apply_filters("give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id); ?> |
|
287 | 287 | </p> |
288 | 288 | </div> |
289 | 289 | <?php endif; ?> |
290 | 290 | |
291 | 291 | <div class="give-admin-box-inside"> |
292 | - <p><?php $purchase_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( esc_attr( give_get_payment_user_email( $payment_id ) ) ) ); ?> |
|
293 | - <a href="<?php echo $purchase_url; ?>"><?php esc_html_e( 'View all donations for this donor »', 'give' ); ?></a> |
|
292 | + <p><?php $purchase_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode(esc_attr(give_get_payment_user_email($payment_id)))); ?> |
|
293 | + <a href="<?php echo $purchase_url; ?>"><?php esc_html_e('View all donations for this donor »', 'give'); ?></a> |
|
294 | 294 | </p> |
295 | 295 | </div> |
296 | 296 | |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | * |
303 | 303 | * @param int $payment_id Payment id. |
304 | 304 | */ |
305 | - do_action( 'give_view_order_details_payment_meta_after', $payment_id ); |
|
305 | + do_action('give_view_order_details_payment_meta_after', $payment_id); |
|
306 | 306 | ?> |
307 | 307 | |
308 | 308 | </div> |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | * |
323 | 323 | * @param int $payment_id Payment id. |
324 | 324 | */ |
325 | - do_action( 'give_view_order_details_sidebar_after', $payment_id ); |
|
325 | + do_action('give_view_order_details_sidebar_after', $payment_id); |
|
326 | 326 | ?> |
327 | 327 | |
328 | 328 | </div> |
@@ -342,55 +342,55 @@ discard block |
||
342 | 342 | * |
343 | 343 | * @param int $payment_id Payment id. |
344 | 344 | */ |
345 | - do_action( 'give_view_order_details_main_before', $payment_id ); |
|
345 | + do_action('give_view_order_details_main_before', $payment_id); |
|
346 | 346 | ?> |
347 | 347 | |
348 | 348 | <?php $column_count = 'columns-3'; ?> |
349 | 349 | <div id="give-donation-overview" class="postbox <?php echo $column_count; ?>"> |
350 | - <h3 class="hndle"><?php esc_html_e( 'Donation Information', 'give' ); ?></h3> |
|
350 | + <h3 class="hndle"><?php esc_html_e('Donation Information', 'give'); ?></h3> |
|
351 | 351 | |
352 | 352 | <div class="inside"> |
353 | 353 | |
354 | 354 | <div class="column-container"> |
355 | 355 | <div class="column"> |
356 | 356 | <p> |
357 | - <strong><?php esc_html_e( 'Donation Form ID:', 'give' ); ?></strong><br> |
|
357 | + <strong><?php esc_html_e('Donation Form ID:', 'give'); ?></strong><br> |
|
358 | 358 | <?php |
359 | - if ( $payment_meta['form_id'] ) : |
|
359 | + if ($payment_meta['form_id']) : |
|
360 | 360 | printf( |
361 | 361 | '<a href="%1$s" target="_blank">#%2$s</a>', |
362 | - admin_url( 'post.php?action=edit&post=' . $payment_meta['form_id'] ), |
|
362 | + admin_url('post.php?action=edit&post='.$payment_meta['form_id']), |
|
363 | 363 | $payment_meta['form_id'] |
364 | 364 | ); |
365 | 365 | endif; |
366 | 366 | ?> |
367 | 367 | </p> |
368 | 368 | <p> |
369 | - <strong><?php esc_html_e( 'Donation Form Title:', 'give' ); ?></strong><br> |
|
370 | - <?php give_get_form_dropdown( array( |
|
369 | + <strong><?php esc_html_e('Donation Form Title:', 'give'); ?></strong><br> |
|
370 | + <?php give_get_form_dropdown(array( |
|
371 | 371 | 'id' => $payment_meta['form_id'], |
372 | 372 | 'selected' => $payment_meta['form_id'], |
373 | 373 | 'chosen' => true, |
374 | - ), true ); ?> |
|
374 | + ), true); ?> |
|
375 | 375 | </p> |
376 | 376 | </div> |
377 | 377 | <div class="column"> |
378 | 378 | <p> |
379 | - <strong><?php esc_html_e( 'Donation Date:', 'give' ); ?></strong><br> |
|
380 | - <?php echo date_i18n( give_date_format(), $payment_date ); ?> |
|
379 | + <strong><?php esc_html_e('Donation Date:', 'give'); ?></strong><br> |
|
380 | + <?php echo date_i18n(give_date_format(), $payment_date); ?> |
|
381 | 381 | </p> |
382 | 382 | <p> |
383 | - <strong><?php esc_html_e( 'Donation Level:', 'give' ); ?></strong><br> |
|
383 | + <strong><?php esc_html_e('Donation Level:', 'give'); ?></strong><br> |
|
384 | 384 | <span class="give-donation-level"> |
385 | 385 | <?php |
386 | - $var_prices = give_has_variable_prices( $payment_meta['form_id'] ); |
|
387 | - if ( empty( $var_prices ) ) { |
|
388 | - esc_html_e( 'n/a', 'give' ); |
|
386 | + $var_prices = give_has_variable_prices($payment_meta['form_id']); |
|
387 | + if (empty($var_prices)) { |
|
388 | + esc_html_e('n/a', 'give'); |
|
389 | 389 | } else { |
390 | 390 | $prices_atts = ''; |
391 | - if( $variable_prices = give_get_variable_prices( $payment_meta['form_id'] ) ) { |
|
392 | - foreach ( $variable_prices as $variable_price ) { |
|
393 | - $prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount( $variable_price['_give_amount'] ); |
|
391 | + if ($variable_prices = give_get_variable_prices($payment_meta['form_id'])) { |
|
392 | + foreach ($variable_prices as $variable_price) { |
|
393 | + $prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount($variable_price['_give_amount']); |
|
394 | 394 | } |
395 | 395 | } |
396 | 396 | // Variable price dropdown options. |
@@ -400,11 +400,11 @@ discard block |
||
400 | 400 | 'chosen' => true, |
401 | 401 | 'show_option_all' => '', |
402 | 402 | 'show_option_none' => '', |
403 | - 'select_atts' => 'data-prices=' . esc_attr( json_encode( $prices_atts ) ), |
|
403 | + 'select_atts' => 'data-prices='.esc_attr(json_encode($prices_atts)), |
|
404 | 404 | 'selected' => $payment_meta['price_id'], |
405 | 405 | ); |
406 | 406 | // Render variable prices select tag html. |
407 | - give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true ); |
|
407 | + give_get_form_variable_price_dropdown($variable_price_dropdown_option, true); |
|
408 | 408 | } |
409 | 409 | ?> |
410 | 410 | </span> |
@@ -412,8 +412,8 @@ discard block |
||
412 | 412 | </div> |
413 | 413 | <div class="column"> |
414 | 414 | <p> |
415 | - <strong><?php esc_html_e( 'Total Donation:', 'give' ); ?></strong><br> |
|
416 | - <?php echo esc_html( give_currency_filter( give_format_amount( give_get_payment_amount( $payment_id ) ) ) ); ?> |
|
415 | + <strong><?php esc_html_e('Total Donation:', 'give'); ?></strong><br> |
|
416 | + <?php echo esc_html(give_currency_filter(give_format_amount(give_get_payment_amount($payment_id)))); ?> |
|
417 | 417 | </p> |
418 | 418 | <p> |
419 | 419 | <?php |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | * |
427 | 427 | * @param int $payment_id Payment id. |
428 | 428 | */ |
429 | - do_action( 'give_donation_details_thead_before', $payment_id ); |
|
429 | + do_action('give_donation_details_thead_before', $payment_id); |
|
430 | 430 | |
431 | 431 | |
432 | 432 | /** |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | * |
439 | 439 | * @param int $payment_id Payment id. |
440 | 440 | */ |
441 | - do_action( 'give_donation_details_thead_after', $payment_id ); |
|
441 | + do_action('give_donation_details_thead_after', $payment_id); |
|
442 | 442 | |
443 | 443 | /** |
444 | 444 | * Fires in order details page, in the donation-information metabox, before the body elements. |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | * |
450 | 450 | * @param int $payment_id Payment id. |
451 | 451 | */ |
452 | - do_action( 'give_donation_details_tbody_before', $payment_id ); |
|
452 | + do_action('give_donation_details_tbody_before', $payment_id); |
|
453 | 453 | |
454 | 454 | /** |
455 | 455 | * Fires in order details page, in the donation-information metabox, after the body elements. |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | * |
461 | 461 | * @param int $payment_id Payment id. |
462 | 462 | */ |
463 | - do_action( 'give_donation_details_tbody_after', $payment_id ); |
|
463 | + do_action('give_donation_details_tbody_after', $payment_id); |
|
464 | 464 | ?> |
465 | 465 | </p> |
466 | 466 | </div> |
@@ -480,57 +480,57 @@ discard block |
||
480 | 480 | * |
481 | 481 | * @param int $payment_id Payment id. |
482 | 482 | */ |
483 | - do_action( 'give_view_order_details_files_after', $payment_id ); |
|
483 | + do_action('give_view_order_details_files_after', $payment_id); |
|
484 | 484 | ?> |
485 | 485 | |
486 | 486 | <div id="give-donor-details" class="postbox"> |
487 | - <h3 class="hndle"><?php esc_html_e( 'Donor Details', 'give' ); ?></h3> |
|
487 | + <h3 class="hndle"><?php esc_html_e('Donor Details', 'give'); ?></h3> |
|
488 | 488 | |
489 | 489 | <div class="inside"> |
490 | 490 | |
491 | - <?php $customer = new Give_Customer( $customer_id ); ?> |
|
491 | + <?php $customer = new Give_Customer($customer_id); ?> |
|
492 | 492 | |
493 | 493 | <div class="column-container customer-info"> |
494 | 494 | <div class="column"> |
495 | 495 | <p> |
496 | - <strong><?php esc_html_e( 'Donor ID:', 'give' ); ?></strong><br> |
|
496 | + <strong><?php esc_html_e('Donor ID:', 'give'); ?></strong><br> |
|
497 | 497 | <?php |
498 | - if ( ! empty( $customer->id ) ) { |
|
498 | + if ( ! empty($customer->id)) { |
|
499 | 499 | printf( |
500 | 500 | '<a href="%1$s" target="_blank">#%2$s</a>', |
501 | - admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer->id ), |
|
501 | + admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer->id), |
|
502 | 502 | $customer->id |
503 | 503 | ); |
504 | 504 | } |
505 | 505 | ?> |
506 | 506 | </p> |
507 | 507 | <p> |
508 | - <strong><?php esc_html_e( 'Donor Since:', 'give' ); ?></strong><br> |
|
509 | - <?php echo date_i18n( give_date_format(), strtotime( $customer->date_created ) ) ?> |
|
508 | + <strong><?php esc_html_e('Donor Since:', 'give'); ?></strong><br> |
|
509 | + <?php echo date_i18n(give_date_format(), strtotime($customer->date_created)) ?> |
|
510 | 510 | </p> |
511 | 511 | </div> |
512 | 512 | <div class="column"> |
513 | 513 | <p> |
514 | - <strong><?php esc_html_e( 'Donor Name:', 'give' ); ?></strong><br> |
|
514 | + <strong><?php esc_html_e('Donor Name:', 'give'); ?></strong><br> |
|
515 | 515 | <?php echo $customer->name; ?> |
516 | 516 | </p> |
517 | 517 | <p> |
518 | - <strong><?php esc_html_e( 'Donor Email:', 'give' ); ?></strong><br> |
|
518 | + <strong><?php esc_html_e('Donor Email:', 'give'); ?></strong><br> |
|
519 | 519 | <?php echo $customer->email; ?> |
520 | 520 | </p> |
521 | 521 | </div> |
522 | 522 | <div class="column"> |
523 | 523 | <p> |
524 | - <strong><?php esc_html_e( 'Change Donor:', 'give' ); ?></strong><br> |
|
524 | + <strong><?php esc_html_e('Change Donor:', 'give'); ?></strong><br> |
|
525 | 525 | <?php |
526 | - echo Give()->html->donor_dropdown( array( |
|
526 | + echo Give()->html->donor_dropdown(array( |
|
527 | 527 | 'selected' => $customer->id, |
528 | 528 | 'name' => 'customer-id', |
529 | - ) ); |
|
529 | + )); |
|
530 | 530 | ?> |
531 | 531 | </p> |
532 | 532 | <p> |
533 | - <a href="#new" class="give-payment-new-customer"><?php esc_html_e( 'Create New Donor', 'give' ); ?></a> |
|
533 | + <a href="#new" class="give-payment-new-customer"><?php esc_html_e('Create New Donor', 'give'); ?></a> |
|
534 | 534 | </p> |
535 | 535 | </div> |
536 | 536 | </div> |
@@ -538,13 +538,13 @@ discard block |
||
538 | 538 | <div class="column-container new-customer" style="display: none"> |
539 | 539 | <div class="column"> |
540 | 540 | <p> |
541 | - <label for="give-new-customer-name"><?php esc_html_e( 'New Donor Name:', 'give' ); ?></label> |
|
541 | + <label for="give-new-customer-name"><?php esc_html_e('New Donor Name:', 'give'); ?></label> |
|
542 | 542 | <input id="give-new-customer-name" type="text" name="give-new-customer-name" value="" class="medium-text"/> |
543 | 543 | </p> |
544 | 544 | </div> |
545 | 545 | <div class="column"> |
546 | 546 | <p> |
547 | - <label for="give-new-customer-email"><?php esc_html_e( 'New Donor Email:', 'give' ); ?></label> |
|
547 | + <label for="give-new-customer-email"><?php esc_html_e('New Donor Email:', 'give'); ?></label> |
|
548 | 548 | <input id="give-new-customer-email" type="email" name="give-new-customer-email" value="" class="medium-text"/> |
549 | 549 | </p> |
550 | 550 | </div> |
@@ -552,9 +552,9 @@ discard block |
||
552 | 552 | <p> |
553 | 553 | <input type="hidden" name="give-current-customer" value="<?php echo $customer->id; ?>"/> |
554 | 554 | <input type="hidden" id="give-new-customer" name="give-new-customer" value="0"/> |
555 | - <a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a> |
|
555 | + <a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e('Cancel', 'give'); ?></a> |
|
556 | 556 | <br> |
557 | - <em><?php esc_html_e( 'Click "Save Donation" to create new donor.', 'give' ); ?></em> |
|
557 | + <em><?php esc_html_e('Click "Save Donation" to create new donor.', 'give'); ?></em> |
|
558 | 558 | </p> |
559 | 559 | </div> |
560 | 560 | </div> |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | * @param array $payment_meta Payment meta. |
571 | 571 | * @param array $user_info User information. |
572 | 572 | */ |
573 | - do_action( 'give_payment_personal_details_list', $payment_meta, $user_info ); |
|
573 | + do_action('give_payment_personal_details_list', $payment_meta, $user_info); |
|
574 | 574 | |
575 | 575 | /** |
576 | 576 | * Fires in order details page, in the donor-details metabox. |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | * |
580 | 580 | * @param int $payment_id Payment id. |
581 | 581 | */ |
582 | - do_action( 'give_payment_view_details', $payment_id ); |
|
582 | + do_action('give_payment_view_details', $payment_id); |
|
583 | 583 | ?> |
584 | 584 | |
585 | 585 | </div> |
@@ -595,11 +595,11 @@ discard block |
||
595 | 595 | * |
596 | 596 | * @param int $payment_id Payment id. |
597 | 597 | */ |
598 | - do_action( 'give_view_order_details_billing_before', $payment_id ); |
|
598 | + do_action('give_view_order_details_billing_before', $payment_id); |
|
599 | 599 | ?> |
600 | 600 | |
601 | 601 | <div id="give-billing-details" class="postbox"> |
602 | - <h3 class="hndle"><?php esc_html_e( 'Billing Address', 'give' ); ?></h3> |
|
602 | + <h3 class="hndle"><?php esc_html_e('Billing Address', 'give'); ?></h3> |
|
603 | 603 | |
604 | 604 | <div class="inside"> |
605 | 605 | |
@@ -609,57 +609,57 @@ discard block |
||
609 | 609 | <div class="data column-container"> |
610 | 610 | <div class="column"> |
611 | 611 | <div class="give-wrap-address-line1"> |
612 | - <label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e( 'Address 1:', 'give' ); ?></label> |
|
613 | - <input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr( $address['line1'] ); ?>" class="medium-text"/> |
|
612 | + <label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e('Address 1:', 'give'); ?></label> |
|
613 | + <input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr($address['line1']); ?>" class="medium-text"/> |
|
614 | 614 | </div> |
615 | 615 | <div class="give-wrap-address-line2"> |
616 | - <label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e( 'Address 2:', 'give' ); ?></label> |
|
617 | - <input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr( $address['line2'] ); ?>" class="medium-text"/> |
|
616 | + <label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e('Address 2:', 'give'); ?></label> |
|
617 | + <input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr($address['line2']); ?>" class="medium-text"/> |
|
618 | 618 | </div> |
619 | 619 | </div> |
620 | 620 | <div class="column"> |
621 | 621 | <div class="give-wrap-address-city"> |
622 | - <label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e( 'City:', 'give' ); ?></label> |
|
623 | - <input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr( $address['city'] ); ?>" class="medium-text"/> |
|
622 | + <label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e('City:', 'give'); ?></label> |
|
623 | + <input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr($address['city']); ?>" class="medium-text"/> |
|
624 | 624 | </div> |
625 | 625 | <div class="give-wrap-address-zip"> |
626 | - <label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e( 'Zip / Postal Code:', 'give' ); ?></label> |
|
627 | - <input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr( $address['zip'] ); ?>" class="medium-text"/> |
|
626 | + <label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e('Zip / Postal Code:', 'give'); ?></label> |
|
627 | + <input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr($address['zip']); ?>" class="medium-text"/> |
|
628 | 628 | |
629 | 629 | </div> |
630 | 630 | </div> |
631 | 631 | <div class="column"> |
632 | 632 | <div id="give-order-address-country-wrap"> |
633 | - <label class="order-data-address-line"><?php esc_html_e( 'Country:', 'give' ); ?></label> |
|
633 | + <label class="order-data-address-line"><?php esc_html_e('Country:', 'give'); ?></label> |
|
634 | 634 | <?php |
635 | - echo Give()->html->select( array( |
|
635 | + echo Give()->html->select(array( |
|
636 | 636 | 'options' => give_get_country_list(), |
637 | 637 | 'name' => 'give-payment-address[0][country]', |
638 | 638 | 'selected' => $address['country'], |
639 | 639 | 'show_option_all' => false, |
640 | 640 | 'show_option_none' => false, |
641 | 641 | 'chosen' => true, |
642 | - 'placeholder' => esc_attr__( 'Select a country', 'give' ), |
|
643 | - ) ); |
|
642 | + 'placeholder' => esc_attr__('Select a country', 'give'), |
|
643 | + )); |
|
644 | 644 | ?> |
645 | 645 | </div> |
646 | 646 | <div id="give-order-address-state-wrap"> |
647 | - <label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e( 'State / Province:', 'give' ); ?></label> |
|
647 | + <label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e('State / Province:', 'give'); ?></label> |
|
648 | 648 | <?php |
649 | - $states = give_get_states( $address['country'] ); |
|
650 | - if ( ! empty( $states ) ) { |
|
651 | - echo Give()->html->select( array( |
|
649 | + $states = give_get_states($address['country']); |
|
650 | + if ( ! empty($states)) { |
|
651 | + echo Give()->html->select(array( |
|
652 | 652 | 'options' => $states, |
653 | 653 | 'name' => 'give-payment-address[0][state]', |
654 | 654 | 'selected' => $address['state'], |
655 | 655 | 'show_option_all' => false, |
656 | 656 | 'show_option_none' => false, |
657 | 657 | 'chosen' => true, |
658 | - 'placeholder' => esc_attr__( 'Select a state', 'give' ), |
|
659 | - ) ); |
|
658 | + 'placeholder' => esc_attr__('Select a state', 'give'), |
|
659 | + )); |
|
660 | 660 | } else { |
661 | 661 | ?> |
662 | - <input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr( $address['state'] ); ?>" class="medium-text"/> |
|
662 | + <input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr($address['state']); ?>" class="medium-text"/> |
|
663 | 663 | <?php |
664 | 664 | } ?> |
665 | 665 | </div> |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | * |
680 | 680 | * @param int $payment_id Payment id. |
681 | 681 | */ |
682 | - do_action( 'give_payment_billing_details', $payment_id ); |
|
682 | + do_action('give_payment_billing_details', $payment_id); |
|
683 | 683 | ?> |
684 | 684 | |
685 | 685 | </div> |
@@ -695,32 +695,32 @@ discard block |
||
695 | 695 | * |
696 | 696 | * @param int $payment_id Payment id. |
697 | 697 | */ |
698 | - do_action( 'give_view_order_details_billing_after', $payment_id ); |
|
698 | + do_action('give_view_order_details_billing_after', $payment_id); |
|
699 | 699 | ?> |
700 | 700 | |
701 | 701 | <div id="give-payment-notes" class="postbox"> |
702 | - <h3 class="hndle"><?php esc_html_e( 'Donation Notes', 'give' ); ?></h3> |
|
702 | + <h3 class="hndle"><?php esc_html_e('Donation Notes', 'give'); ?></h3> |
|
703 | 703 | |
704 | 704 | <div class="inside"> |
705 | 705 | <div id="give-payment-notes-inner"> |
706 | 706 | <?php |
707 | - $notes = give_get_payment_notes( $payment_id ); |
|
708 | - if ( ! empty( $notes ) ) { |
|
707 | + $notes = give_get_payment_notes($payment_id); |
|
708 | + if ( ! empty($notes)) { |
|
709 | 709 | $no_notes_display = ' style="display:none;"'; |
710 | - foreach ( $notes as $note ) : |
|
710 | + foreach ($notes as $note) : |
|
711 | 711 | |
712 | - echo give_get_payment_note_html( $note, $payment_id ); |
|
712 | + echo give_get_payment_note_html($note, $payment_id); |
|
713 | 713 | |
714 | 714 | endforeach; |
715 | 715 | } else { |
716 | 716 | $no_notes_display = ''; |
717 | 717 | } |
718 | - echo '<p class="give-no-payment-notes"' . $no_notes_display . '>' . esc_html__( 'No donation notes.', 'give' ) . '</p>'; ?> |
|
718 | + echo '<p class="give-no-payment-notes"'.$no_notes_display.'>'.esc_html__('No donation notes.', 'give').'</p>'; ?> |
|
719 | 719 | </div> |
720 | 720 | <textarea name="give-payment-note" id="give-payment-note" class="large-text"></textarea> |
721 | 721 | |
722 | 722 | <div class="give-clearfix"> |
723 | - <button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint( $payment_id ); ?>"><?php esc_html_e( 'Add Note', 'give' ); ?></button> |
|
723 | + <button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint($payment_id); ?>"><?php esc_html_e('Add Note', 'give'); ?></button> |
|
724 | 724 | </div> |
725 | 725 | |
726 | 726 | </div> |
@@ -736,7 +736,7 @@ discard block |
||
736 | 736 | * |
737 | 737 | * @param int $payment_id Payment id. |
738 | 738 | */ |
739 | - do_action( 'give_view_order_details_main_after', $payment_id ); |
|
739 | + do_action('give_view_order_details_main_after', $payment_id); |
|
740 | 740 | ?> |
741 | 741 | |
742 | 742 | </div> |
@@ -758,11 +758,11 @@ discard block |
||
758 | 758 | * |
759 | 759 | * @param int $payment_id Payment id. |
760 | 760 | */ |
761 | - do_action( 'give_view_order_details_form_bottom', $payment_id ); |
|
761 | + do_action('give_view_order_details_form_bottom', $payment_id); |
|
762 | 762 | |
763 | - wp_nonce_field( 'give_update_payment_details_nonce' ); |
|
763 | + wp_nonce_field('give_update_payment_details_nonce'); |
|
764 | 764 | ?> |
765 | - <input type="hidden" name="give_payment_id" value="<?php echo esc_attr( $payment_id ); ?>"/> |
|
765 | + <input type="hidden" name="give_payment_id" value="<?php echo esc_attr($payment_id); ?>"/> |
|
766 | 766 | <input type="hidden" name="give_action" value="update_payment_details"/> |
767 | 767 | </form> |
768 | 768 | <?php |
@@ -773,6 +773,6 @@ discard block |
||
773 | 773 | * |
774 | 774 | * @param int $payment_id Payment id. |
775 | 775 | */ |
776 | - do_action( 'give_view_order_details_after', $payment_id ); |
|
776 | + do_action('give_view_order_details_after', $payment_id); |
|
777 | 777 | ?> |
778 | 778 | </div><!-- /.wrap --> |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | * @license https://opensource.org/licenses/gpl-license GNU Public License |
11 | 11 | */ |
12 | 12 | |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | */ |
23 | 23 | function give_process_batch_export_form() { |
24 | 24 | |
25 | - if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'give-batch-export' ) ) { |
|
26 | - wp_die( esc_html__( 'Nonce verification failed.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
25 | + if ( ! wp_verify_nonce($_REQUEST['nonce'], 'give-batch-export')) { |
|
26 | + wp_die(esc_html__('Nonce verification failed.', 'give'), esc_html__('Error', 'give'), array('response' => 403)); |
|
27 | 27 | } |
28 | 28 | |
29 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export.php'; |
|
29 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export.php'; |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Fires before batch export. |
@@ -35,14 +35,14 @@ discard block |
||
35 | 35 | * |
36 | 36 | * @param string $class Export class. |
37 | 37 | */ |
38 | - do_action( 'give_batch_export_class_include', $_REQUEST['class'] ); |
|
38 | + do_action('give_batch_export_class_include', $_REQUEST['class']); |
|
39 | 39 | |
40 | 40 | $export = new $_REQUEST['class']; |
41 | 41 | $export->export(); |
42 | 42 | |
43 | 43 | } |
44 | 44 | |
45 | -add_action( 'give_form_batch_export', 'give_process_batch_export_form' ); |
|
45 | +add_action('give_form_batch_export', 'give_process_batch_export_form'); |
|
46 | 46 | |
47 | 47 | /** |
48 | 48 | * Exports earnings for a specified time period |
@@ -53,14 +53,14 @@ discard block |
||
53 | 53 | * @return void |
54 | 54 | */ |
55 | 55 | function give_export_earnings() { |
56 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-export-earnings.php'; |
|
56 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-export-earnings.php'; |
|
57 | 57 | |
58 | 58 | $earnings_export = new Give_Earnings_Export(); |
59 | 59 | |
60 | 60 | $earnings_export->export(); |
61 | 61 | } |
62 | 62 | |
63 | -add_action( 'give_earnings_export', 'give_export_earnings' ); |
|
63 | +add_action('give_earnings_export', 'give_export_earnings'); |
|
64 | 64 | |
65 | 65 | |
66 | 66 | /** |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @return void |
71 | 71 | */ |
72 | 72 | function give_register_batch_exporters() { |
73 | - if ( is_admin() ) { |
|
73 | + if (is_admin()) { |
|
74 | 74 | /** |
75 | 75 | * Fires in the admin, while plugins loaded. |
76 | 76 | * |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @param string $class Export class. |
82 | 82 | */ |
83 | - do_action( 'give_register_batch_exporter' ); |
|
83 | + do_action('give_register_batch_exporter'); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
87 | -add_action( 'plugins_loaded', 'give_register_batch_exporters' ); |
|
87 | +add_action('plugins_loaded', 'give_register_batch_exporters'); |
|
88 | 88 | |
89 | 89 | /** |
90 | 90 | * Register the payments batch exporter |
@@ -92,10 +92,10 @@ discard block |
||
92 | 92 | * @since 1.5 |
93 | 93 | */ |
94 | 94 | function give_register_payments_batch_export() { |
95 | - add_action( 'give_batch_export_class_include', 'give_include_payments_batch_processor', 10, 1 ); |
|
95 | + add_action('give_batch_export_class_include', 'give_include_payments_batch_processor', 10, 1); |
|
96 | 96 | } |
97 | 97 | |
98 | -add_action( 'give_register_batch_exporter', 'give_register_payments_batch_export', 10 ); |
|
98 | +add_action('give_register_batch_exporter', 'give_register_payments_batch_export', 10); |
|
99 | 99 | |
100 | 100 | /** |
101 | 101 | * Loads the payments batch process if needed |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | * |
107 | 107 | * @return void |
108 | 108 | */ |
109 | -function give_include_payments_batch_processor( $class ) { |
|
109 | +function give_include_payments_batch_processor($class) { |
|
110 | 110 | |
111 | - if ( 'Give_Batch_Payments_Export' === $class ) { |
|
112 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-payments.php'; |
|
111 | + if ('Give_Batch_Payments_Export' === $class) { |
|
112 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export-payments.php'; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | } |
@@ -120,10 +120,10 @@ discard block |
||
120 | 120 | * @since 1.5.2 |
121 | 121 | */ |
122 | 122 | function give_register_customers_batch_export() { |
123 | - add_action( 'give_batch_export_class_include', 'give_include_customers_batch_processor', 10, 1 ); |
|
123 | + add_action('give_batch_export_class_include', 'give_include_customers_batch_processor', 10, 1); |
|
124 | 124 | } |
125 | 125 | |
126 | -add_action( 'give_register_batch_exporter', 'give_register_customers_batch_export', 10 ); |
|
126 | +add_action('give_register_batch_exporter', 'give_register_customers_batch_export', 10); |
|
127 | 127 | |
128 | 128 | /** |
129 | 129 | * Loads the customers batch process if needed |
@@ -134,10 +134,10 @@ discard block |
||
134 | 134 | * |
135 | 135 | * @return void |
136 | 136 | */ |
137 | -function give_include_customers_batch_processor( $class ) { |
|
137 | +function give_include_customers_batch_processor($class) { |
|
138 | 138 | |
139 | - if ( 'Give_Batch_Customers_Export' === $class ) { |
|
140 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-customers.php'; |
|
139 | + if ('Give_Batch_Customers_Export' === $class) { |
|
140 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export-customers.php'; |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | } |
@@ -148,10 +148,10 @@ discard block |
||
148 | 148 | * @since 1.5 |
149 | 149 | */ |
150 | 150 | function give_register_forms_batch_export() { |
151 | - add_action( 'give_batch_export_class_include', 'give_include_forms_batch_processor', 10, 1 ); |
|
151 | + add_action('give_batch_export_class_include', 'give_include_forms_batch_processor', 10, 1); |
|
152 | 152 | } |
153 | 153 | |
154 | -add_action( 'give_register_batch_exporter', 'give_register_forms_batch_export', 10 ); |
|
154 | +add_action('give_register_batch_exporter', 'give_register_forms_batch_export', 10); |
|
155 | 155 | |
156 | 156 | /** |
157 | 157 | * Loads the file downloads batch process if needed |
@@ -162,10 +162,10 @@ discard block |
||
162 | 162 | * |
163 | 163 | * @return void |
164 | 164 | */ |
165 | -function give_include_forms_batch_processor( $class ) { |
|
165 | +function give_include_forms_batch_processor($class) { |
|
166 | 166 | |
167 | - if ( 'Give_Batch_Forms_Export' === $class ) { |
|
168 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-forms.php'; |
|
167 | + if ('Give_Batch_Forms_Export' === $class) { |
|
168 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export-forms.php'; |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * |
73 | 73 | * @param $url |
74 | 74 | * |
75 | - * @return mixed |
|
75 | + * @return string |
|
76 | 76 | */ |
77 | 77 | public function give_update_cmb_meta_box_url( $url ) { |
78 | 78 | // Path to Give's CMB |
@@ -834,7 +834,7 @@ discard block |
||
834 | 834 | * @since 1.0 |
835 | 835 | * |
836 | 836 | * @param string $key The Key to update |
837 | - * @param string|bool|int $value The value to set the key to |
|
837 | + * @param integer $value The value to set the key to |
|
838 | 838 | * |
839 | 839 | * @return boolean True if updated, false if not. |
840 | 840 | */ |
@@ -937,7 +937,7 @@ discard block |
||
937 | 937 | * @since 1.3.5 |
938 | 938 | * |
939 | 939 | * @param $array |
940 | - * @param $position |int|string Expects an array key or 'id' of the settings field to appear after |
|
940 | + * @param string $position |int|string Expects an array key or 'id' of the settings field to appear after |
|
941 | 941 | * @param $insert |array a valid array of options to insert |
942 | 942 | * |
943 | 943 | * @return array |
@@ -976,7 +976,7 @@ discard block |
||
976 | 976 | * @since 1.0 |
977 | 977 | * |
978 | 978 | * @param array $field_arr |
979 | - * @param array $saved_values |
|
979 | + * @param string|boolean $saved_values |
|
980 | 980 | * |
981 | 981 | * @return void |
982 | 982 | */ |
@@ -1011,7 +1011,7 @@ discard block |
||
1011 | 1011 | * @since 1.0 |
1012 | 1012 | * |
1013 | 1013 | * @param array $field_arr |
1014 | - * @param array $saved_value |
|
1014 | + * @param string|boolean $saved_value |
|
1015 | 1015 | * |
1016 | 1016 | * @return void |
1017 | 1017 | */ |
@@ -43,14 +43,14 @@ discard block |
||
43 | 43 | public function __construct() { |
44 | 44 | |
45 | 45 | // Custom CMB2 Settings Fields |
46 | - add_action( 'cmb2_render_give_title', 'give_title_callback', 10, 5 ); |
|
47 | - add_action( 'cmb2_render_give_description', 'give_description_callback', 10, 5 ); |
|
48 | - add_action( 'cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5 ); |
|
49 | - add_action( 'cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5 ); |
|
50 | - add_action( 'cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5 ); |
|
51 | - add_action( 'cmb2_render_system_info', 'give_system_info_callback', 10, 5 ); |
|
52 | - add_action( 'cmb2_render_api', 'give_api_callback', 10, 5 ); |
|
53 | - add_action( 'cmb2_render_license_key', 'give_license_key_callback', 10, 5 ); |
|
46 | + add_action('cmb2_render_give_title', 'give_title_callback', 10, 5); |
|
47 | + add_action('cmb2_render_give_description', 'give_description_callback', 10, 5); |
|
48 | + add_action('cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5); |
|
49 | + add_action('cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5); |
|
50 | + add_action('cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5); |
|
51 | + add_action('cmb2_render_system_info', 'give_system_info_callback', 10, 5); |
|
52 | + add_action('cmb2_render_api', 'give_api_callback', 10, 5); |
|
53 | + add_action('cmb2_render_license_key', 'give_license_key_callback', 10, 5); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @since 1.0 |
61 | 61 | */ |
62 | 62 | public function init() { |
63 | - register_setting( $this->key, $this->key ); |
|
63 | + register_setting($this->key, $this->key); |
|
64 | 64 | |
65 | 65 | } |
66 | 66 | |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | * |
75 | 75 | * @return mixed |
76 | 76 | */ |
77 | - public function give_update_cmb_meta_box_url( $url ) { |
|
77 | + public function give_update_cmb_meta_box_url($url) { |
|
78 | 78 | // Path to Give's CMB |
79 | - return GIVE_PLUGIN_URL . '/includes/libraries/cmb2'; |
|
79 | + return GIVE_PLUGIN_URL.'/includes/libraries/cmb2'; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
@@ -88,27 +88,27 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function give_get_settings_tabs() { |
90 | 90 | |
91 | - $settings = $this->give_settings( null ); |
|
91 | + $settings = $this->give_settings(null); |
|
92 | 92 | |
93 | 93 | $tabs = array(); |
94 | - $tabs['general'] = esc_html__( 'General', 'give' ); |
|
95 | - $tabs['gateways'] = esc_html__( 'Payment Gateways', 'give' ); |
|
96 | - $tabs['display'] = esc_html__( 'Display Options', 'give' ); |
|
97 | - $tabs['emails'] = esc_html__( 'Emails', 'give' ); |
|
94 | + $tabs['general'] = esc_html__('General', 'give'); |
|
95 | + $tabs['gateways'] = esc_html__('Payment Gateways', 'give'); |
|
96 | + $tabs['display'] = esc_html__('Display Options', 'give'); |
|
97 | + $tabs['emails'] = esc_html__('Emails', 'give'); |
|
98 | 98 | |
99 | - if ( ! empty( $settings['addons']['fields'] ) ) { |
|
100 | - $tabs['addons'] = esc_html__( 'Add-ons', 'give' ); |
|
99 | + if ( ! empty($settings['addons']['fields'])) { |
|
100 | + $tabs['addons'] = esc_html__('Add-ons', 'give'); |
|
101 | 101 | } |
102 | 102 | |
103 | - if ( ! empty( $settings['licenses']['fields'] ) ) { |
|
104 | - $tabs['licenses'] = esc_html__( 'Licenses', 'give' ); |
|
103 | + if ( ! empty($settings['licenses']['fields'])) { |
|
104 | + $tabs['licenses'] = esc_html__('Licenses', 'give'); |
|
105 | 105 | } |
106 | 106 | |
107 | - $tabs['advanced'] = esc_html__( 'Advanced', 'give' ); |
|
108 | - $tabs['api'] = esc_html__( 'API', 'give' ); |
|
109 | - $tabs['system_info'] = esc_html__( 'System Info', 'give' ); |
|
107 | + $tabs['advanced'] = esc_html__('Advanced', 'give'); |
|
108 | + $tabs['api'] = esc_html__('API', 'give'); |
|
109 | + $tabs['system_info'] = esc_html__('System Info', 'give'); |
|
110 | 110 | |
111 | - return apply_filters( 'give_settings_tabs', $tabs ); |
|
111 | + return apply_filters('give_settings_tabs', $tabs); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function admin_page_display() { |
121 | 121 | |
122 | - $active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $this->give_get_settings_tabs() ) ? $_GET['tab'] : 'general'; |
|
122 | + $active_tab = isset($_GET['tab']) && array_key_exists($_GET['tab'], $this->give_get_settings_tabs()) ? $_GET['tab'] : 'general'; |
|
123 | 123 | |
124 | 124 | ?> |
125 | 125 | |
@@ -129,22 +129,22 @@ discard block |
||
129 | 129 | |
130 | 130 | <h2 class="nav-tab-wrapper"> |
131 | 131 | <?php |
132 | - foreach ( $this->give_get_settings_tabs() as $tab_id => $tab_name ) { |
|
132 | + foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) { |
|
133 | 133 | |
134 | - $tab_url = esc_url( add_query_arg( array( |
|
134 | + $tab_url = esc_url(add_query_arg(array( |
|
135 | 135 | 'settings-updated' => false, |
136 | 136 | 'tab' => $tab_id, |
137 | - ) ) ); |
|
137 | + ))); |
|
138 | 138 | |
139 | 139 | $active = $active_tab == $tab_id ? ' nav-tab-active' : ''; |
140 | 140 | |
141 | - echo '<a href="' . esc_url( $tab_url ) . '" class="nav-tab' . $active . '" id="tab-' . $tab_id . '">' . esc_html( $tab_name ) . '</a>'; |
|
141 | + echo '<a href="'.esc_url($tab_url).'" class="nav-tab'.$active.'" id="tab-'.$tab_id.'">'.esc_html($tab_name).'</a>'; |
|
142 | 142 | |
143 | 143 | } |
144 | 144 | ?> |
145 | 145 | </h2> |
146 | 146 | |
147 | - <?php cmb2_metabox_form( $this->give_settings( $active_tab ), $this->key ); ?> |
|
147 | + <?php cmb2_metabox_form($this->give_settings($active_tab), $this->key); ?> |
|
148 | 148 | |
149 | 149 | </div><!-- .wrap --> |
150 | 150 | |
@@ -166,12 +166,12 @@ discard block |
||
166 | 166 | * |
167 | 167 | * @return string |
168 | 168 | */ |
169 | - function give_modify_cmb2_form_output( $form_format, $object_id, $cmb ) { |
|
169 | + function give_modify_cmb2_form_output($form_format, $object_id, $cmb) { |
|
170 | 170 | |
171 | 171 | // only modify the give settings form |
172 | - if ( 'give_settings' == $object_id ) { |
|
172 | + if ('give_settings' == $object_id) { |
|
173 | 173 | |
174 | - return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="' . esc_attr__( 'Save Settings', 'give' ) . '" class="button-primary"></div></form>'; |
|
174 | + return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="'.esc_attr__('Save Settings', 'give').'" class="button-primary"></div></form>'; |
|
175 | 175 | |
176 | 176 | } |
177 | 177 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | * |
189 | 189 | * @return array |
190 | 190 | */ |
191 | - public function give_settings( $active_tab ) { |
|
191 | + public function give_settings($active_tab) { |
|
192 | 192 | |
193 | 193 | $give_settings = array( |
194 | 194 | /** |
@@ -196,99 +196,99 @@ discard block |
||
196 | 196 | */ |
197 | 197 | 'general' => array( |
198 | 198 | 'id' => 'general_settings', |
199 | - 'give_title' => esc_html__( 'General Settings', 'give' ), |
|
200 | - 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key ) ), |
|
201 | - 'fields' => apply_filters( 'give_settings_general', array( |
|
199 | + 'give_title' => esc_html__('General Settings', 'give'), |
|
200 | + 'show_on' => array('key' => 'options-page', 'value' => array($this->key)), |
|
201 | + 'fields' => apply_filters('give_settings_general', array( |
|
202 | 202 | array( |
203 | - 'name' => esc_html__( 'General Settings', 'give' ), |
|
203 | + 'name' => esc_html__('General Settings', 'give'), |
|
204 | 204 | 'desc' => '', |
205 | 205 | 'type' => 'give_title', |
206 | 206 | 'id' => 'give_title_general_settings_1', |
207 | 207 | ), |
208 | 208 | array( |
209 | - 'name' => esc_html__( 'Success Page', 'give' ), |
|
209 | + 'name' => esc_html__('Success Page', 'give'), |
|
210 | 210 | /* translators: %s: [give_receipt] */ |
211 | - 'desc' => sprintf( __( 'The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give' ), '<code>[give_receipt]</code>' ), |
|
211 | + 'desc' => sprintf(__('The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give'), '<code>[give_receipt]</code>'), |
|
212 | 212 | 'id' => 'success_page', |
213 | 213 | 'type' => 'select', |
214 | - 'options' => give_cmb2_get_post_options( array( |
|
214 | + 'options' => give_cmb2_get_post_options(array( |
|
215 | 215 | 'post_type' => 'page', |
216 | - 'numberposts' => - 1, |
|
217 | - ) ), |
|
216 | + 'numberposts' => -1, |
|
217 | + )), |
|
218 | 218 | ), |
219 | 219 | array( |
220 | - 'name' => esc_html__( 'Failed Donation Page', 'give' ), |
|
221 | - 'desc' => esc_html__( 'The page donors are sent to if their donation is cancelled or fails.', 'give' ), |
|
220 | + 'name' => esc_html__('Failed Donation Page', 'give'), |
|
221 | + 'desc' => esc_html__('The page donors are sent to if their donation is cancelled or fails.', 'give'), |
|
222 | 222 | 'id' => 'failure_page', |
223 | 223 | 'type' => 'select', |
224 | - 'options' => give_cmb2_get_post_options( array( |
|
224 | + 'options' => give_cmb2_get_post_options(array( |
|
225 | 225 | 'post_type' => 'page', |
226 | - 'numberposts' => - 1, |
|
227 | - ) ), |
|
226 | + 'numberposts' => -1, |
|
227 | + )), |
|
228 | 228 | ), |
229 | 229 | array( |
230 | - 'name' => esc_html__( 'Donation History Page', 'give' ), |
|
230 | + 'name' => esc_html__('Donation History Page', 'give'), |
|
231 | 231 | /* translators: %s: [donation_history] */ |
232 | - 'desc' => sprintf( __( 'The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give' ), '<code>[donation_history]</code>' ), |
|
232 | + 'desc' => sprintf(__('The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give'), '<code>[donation_history]</code>'), |
|
233 | 233 | 'id' => 'history_page', |
234 | 234 | 'type' => 'select', |
235 | - 'options' => give_cmb2_get_post_options( array( |
|
235 | + 'options' => give_cmb2_get_post_options(array( |
|
236 | 236 | 'post_type' => 'page', |
237 | - 'numberposts' => - 1, |
|
238 | - ) ), |
|
237 | + 'numberposts' => -1, |
|
238 | + )), |
|
239 | 239 | ), |
240 | 240 | array( |
241 | - 'name' => esc_html__( 'Base Country', 'give' ), |
|
242 | - 'desc' => esc_html__( 'The country your site operates from.', 'give' ), |
|
241 | + 'name' => esc_html__('Base Country', 'give'), |
|
242 | + 'desc' => esc_html__('The country your site operates from.', 'give'), |
|
243 | 243 | 'id' => 'base_country', |
244 | 244 | 'type' => 'select', |
245 | 245 | 'options' => give_get_country_list(), |
246 | 246 | ), |
247 | 247 | array( |
248 | - 'name' => esc_html__( 'Currency Settings', 'give' ), |
|
248 | + 'name' => esc_html__('Currency Settings', 'give'), |
|
249 | 249 | 'desc' => '', |
250 | 250 | 'type' => 'give_title', |
251 | 251 | 'id' => 'give_title_general_settings_2', |
252 | 252 | ), |
253 | 253 | array( |
254 | - 'name' => esc_html__( 'Currency', 'give' ), |
|
255 | - 'desc' => esc_html__( 'The donation currency. Note that some payment gateways have currency restrictions.', 'give' ), |
|
254 | + 'name' => esc_html__('Currency', 'give'), |
|
255 | + 'desc' => esc_html__('The donation currency. Note that some payment gateways have currency restrictions.', 'give'), |
|
256 | 256 | 'id' => 'currency', |
257 | 257 | 'type' => 'select', |
258 | 258 | 'options' => give_get_currencies(), |
259 | 259 | 'default' => 'USD', |
260 | 260 | ), |
261 | 261 | array( |
262 | - 'name' => esc_html__( 'Currency Position', 'give' ), |
|
263 | - 'desc' => esc_html__( 'The position of the currency symbol.', 'give' ), |
|
262 | + 'name' => esc_html__('Currency Position', 'give'), |
|
263 | + 'desc' => esc_html__('The position of the currency symbol.', 'give'), |
|
264 | 264 | 'id' => 'currency_position', |
265 | 265 | 'type' => 'select', |
266 | 266 | 'options' => array( |
267 | 267 | /* translators: %s: currency symbol */ |
268 | - 'before' => sprintf( esc_html__( 'Before - %s10', 'give' ), give_currency_symbol( give_get_currency() ) ), |
|
268 | + 'before' => sprintf(esc_html__('Before - %s10', 'give'), give_currency_symbol(give_get_currency())), |
|
269 | 269 | /* translators: %s: currency symbol */ |
270 | - 'after' => sprintf( esc_html__( 'After - 10%s', 'give' ), give_currency_symbol( give_get_currency() ) ), |
|
270 | + 'after' => sprintf(esc_html__('After - 10%s', 'give'), give_currency_symbol(give_get_currency())), |
|
271 | 271 | ), |
272 | 272 | 'default' => 'before', |
273 | 273 | ), |
274 | 274 | array( |
275 | - 'name' => esc_html__( 'Thousands Separator', 'give' ), |
|
276 | - 'desc' => esc_html__( 'The symbol (usually , or .) to separate thousands.', 'give' ), |
|
275 | + 'name' => esc_html__('Thousands Separator', 'give'), |
|
276 | + 'desc' => esc_html__('The symbol (usually , or .) to separate thousands.', 'give'), |
|
277 | 277 | 'id' => 'thousands_separator', |
278 | 278 | 'type' => 'text_small', |
279 | 279 | 'sanitization_cb' => 'give_sanitize_thousand_separator', |
280 | 280 | 'default' => ',', |
281 | 281 | ), |
282 | 282 | array( |
283 | - 'name' => esc_html__( 'Decimal Separator', 'give' ), |
|
284 | - 'desc' => esc_html__( 'The symbol (usually , or .) to separate decimal points.', 'give' ), |
|
283 | + 'name' => esc_html__('Decimal Separator', 'give'), |
|
284 | + 'desc' => esc_html__('The symbol (usually , or .) to separate decimal points.', 'give'), |
|
285 | 285 | 'id' => 'decimal_separator', |
286 | 286 | 'type' => 'text_small', |
287 | 287 | 'default' => '.', |
288 | 288 | ), |
289 | 289 | array( |
290 | - 'name' => esc_html__( 'Number of Decimals', 'give' ), |
|
291 | - 'desc' => esc_html__( 'The number of decimal points displayed in amounts.', 'give' ), |
|
290 | + 'name' => esc_html__('Number of Decimals', 'give'), |
|
291 | + 'desc' => esc_html__('The number of decimal points displayed in amounts.', 'give'), |
|
292 | 292 | 'id' => 'number_decimals', |
293 | 293 | 'type' => 'text_small', |
294 | 294 | 'default' => 2, |
@@ -302,83 +302,83 @@ discard block |
||
302 | 302 | */ |
303 | 303 | 'gateways' => array( |
304 | 304 | 'id' => 'payment_gateways', |
305 | - 'give_title' => esc_html__( 'Payment Gateways', 'give' ), |
|
306 | - 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key ) ), |
|
307 | - 'fields' => apply_filters( 'give_settings_gateways', array( |
|
305 | + 'give_title' => esc_html__('Payment Gateways', 'give'), |
|
306 | + 'show_on' => array('key' => 'options-page', 'value' => array($this->key)), |
|
307 | + 'fields' => apply_filters('give_settings_gateways', array( |
|
308 | 308 | array( |
309 | - 'name' => esc_html__( 'Gateways Settings', 'give' ), |
|
309 | + 'name' => esc_html__('Gateways Settings', 'give'), |
|
310 | 310 | 'desc' => '', |
311 | 311 | 'id' => 'give_title_gateway_settings_1', |
312 | 312 | 'type' => 'give_title', |
313 | 313 | ), |
314 | 314 | array( |
315 | - 'name' => esc_html__( 'Test Mode', 'give' ), |
|
316 | - 'desc' => esc_html__( 'While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give' ), |
|
315 | + 'name' => esc_html__('Test Mode', 'give'), |
|
316 | + 'desc' => esc_html__('While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give'), |
|
317 | 317 | 'id' => 'test_mode', |
318 | 318 | 'type' => 'checkbox', |
319 | 319 | ), |
320 | 320 | array( |
321 | - 'name' => esc_html__( 'Enabled Gateways', 'give' ), |
|
322 | - 'desc' => esc_html__( 'Enable your payment gateway. Can be ordered by dragging.', 'give' ), |
|
321 | + 'name' => esc_html__('Enabled Gateways', 'give'), |
|
322 | + 'desc' => esc_html__('Enable your payment gateway. Can be ordered by dragging.', 'give'), |
|
323 | 323 | 'id' => 'gateways', |
324 | 324 | 'type' => 'enabled_gateways', |
325 | 325 | ), |
326 | 326 | array( |
327 | - 'name' => esc_html__( 'Default Gateway', 'give' ), |
|
328 | - 'desc' => esc_html__( 'The gateway that will be selected by default.', 'give' ), |
|
327 | + 'name' => esc_html__('Default Gateway', 'give'), |
|
328 | + 'desc' => esc_html__('The gateway that will be selected by default.', 'give'), |
|
329 | 329 | 'id' => 'default_gateway', |
330 | 330 | 'type' => 'default_gateway', |
331 | 331 | ), |
332 | 332 | array( |
333 | - 'name' => esc_html__( 'PayPal Standard', 'give' ), |
|
333 | + 'name' => esc_html__('PayPal Standard', 'give'), |
|
334 | 334 | 'desc' => '', |
335 | 335 | 'type' => 'give_title', |
336 | 336 | 'id' => 'give_title_gateway_settings_2', |
337 | 337 | ), |
338 | 338 | array( |
339 | - 'name' => esc_html__( 'PayPal Email', 'give' ), |
|
340 | - 'desc' => esc_html__( 'Enter your PayPal account\'s email.', 'give' ), |
|
339 | + 'name' => esc_html__('PayPal Email', 'give'), |
|
340 | + 'desc' => esc_html__('Enter your PayPal account\'s email.', 'give'), |
|
341 | 341 | 'id' => 'paypal_email', |
342 | 342 | 'type' => 'text_email', |
343 | 343 | ), |
344 | 344 | array( |
345 | - 'name' => esc_html__( 'PayPal Page Style', 'give' ), |
|
346 | - 'desc' => esc_html__( 'Enter the name of the page style to use, or leave blank to use the default.', 'give' ), |
|
345 | + 'name' => esc_html__('PayPal Page Style', 'give'), |
|
346 | + 'desc' => esc_html__('Enter the name of the page style to use, or leave blank to use the default.', 'give'), |
|
347 | 347 | 'id' => 'paypal_page_style', |
348 | 348 | 'type' => 'text', |
349 | 349 | ), |
350 | 350 | array( |
351 | - 'name' => esc_html__( 'PayPal Transaction Type', 'give' ), |
|
352 | - 'desc' => esc_html__( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ), |
|
351 | + 'name' => esc_html__('PayPal Transaction Type', 'give'), |
|
352 | + 'desc' => esc_html__('Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give'), |
|
353 | 353 | 'id' => 'paypal_button_type', |
354 | 354 | 'type' => 'radio_inline', |
355 | 355 | 'options' => array( |
356 | - 'donation' => esc_html__( 'Donation', 'give' ), |
|
357 | - 'standard' => esc_html__( 'Standard Transaction', 'give' ), |
|
356 | + 'donation' => esc_html__('Donation', 'give'), |
|
357 | + 'standard' => esc_html__('Standard Transaction', 'give'), |
|
358 | 358 | ), |
359 | 359 | 'default' => 'donation', |
360 | 360 | ), |
361 | 361 | array( |
362 | - 'name' => esc_html__( 'Disable PayPal IPN Verification', 'give' ), |
|
363 | - 'desc' => esc_html__( 'If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give' ), |
|
362 | + 'name' => esc_html__('Disable PayPal IPN Verification', 'give'), |
|
363 | + 'desc' => esc_html__('If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give'), |
|
364 | 364 | 'id' => 'disable_paypal_verification', |
365 | 365 | 'type' => 'checkbox', |
366 | 366 | ), |
367 | 367 | array( |
368 | - 'name' => esc_html__( 'Offline Donations', 'give' ), |
|
368 | + 'name' => esc_html__('Offline Donations', 'give'), |
|
369 | 369 | 'desc' => '', |
370 | 370 | 'type' => 'give_title', |
371 | 371 | 'id' => 'give_title_gateway_settings_3', |
372 | 372 | ), |
373 | 373 | array( |
374 | - 'name' => esc_html__( 'Collect Billing Details', 'give' ), |
|
375 | - 'desc' => esc_html__( 'Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give' ), |
|
374 | + 'name' => esc_html__('Collect Billing Details', 'give'), |
|
375 | + 'desc' => esc_html__('Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give'), |
|
376 | 376 | 'id' => 'give_offline_donation_enable_billing_fields', |
377 | 377 | 'type' => 'checkbox', |
378 | 378 | ), |
379 | 379 | array( |
380 | - 'name' => esc_html__( 'Offline Donation Instructions', 'give' ), |
|
381 | - 'desc' => esc_html__( 'The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give' ), |
|
380 | + 'name' => esc_html__('Offline Donation Instructions', 'give'), |
|
381 | + 'desc' => esc_html__('The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give'), |
|
382 | 382 | 'id' => 'global_offline_donation_content', |
383 | 383 | 'default' => give_get_default_offline_donation_content(), |
384 | 384 | 'type' => 'wysiwyg', |
@@ -387,15 +387,15 @@ discard block |
||
387 | 387 | ), |
388 | 388 | ), |
389 | 389 | array( |
390 | - 'name' => esc_html__( 'Offline Donation Email Instructions Subject', 'give' ), |
|
391 | - 'desc' => esc_html__( 'Enter the subject line for the donation receipt email.', 'give' ), |
|
390 | + 'name' => esc_html__('Offline Donation Email Instructions Subject', 'give'), |
|
391 | + 'desc' => esc_html__('Enter the subject line for the donation receipt email.', 'give'), |
|
392 | 392 | 'id' => 'offline_donation_subject', |
393 | - 'default' => esc_attr__( '{donation} - Offline Donation Instructions', 'give' ), |
|
393 | + 'default' => esc_attr__('{donation} - Offline Donation Instructions', 'give'), |
|
394 | 394 | 'type' => 'text', |
395 | 395 | ), |
396 | 396 | array( |
397 | - 'name' => esc_html__( 'Offline Donation Email Instructions', 'give' ), |
|
398 | - 'desc' => esc_html__( 'Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give' ), |
|
397 | + 'name' => esc_html__('Offline Donation Email Instructions', 'give'), |
|
398 | + 'desc' => esc_html__('Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give'), |
|
399 | 399 | 'id' => 'global_offline_donation_email', |
400 | 400 | 'default' => give_get_default_offline_donation_email_content(), |
401 | 401 | 'type' => 'wysiwyg', |
@@ -409,104 +409,104 @@ discard block |
||
409 | 409 | /** Display Settings */ |
410 | 410 | 'display' => array( |
411 | 411 | 'id' => 'display_settings', |
412 | - 'give_title' => esc_html__( 'Display Settings', 'give' ), |
|
413 | - 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key ) ), |
|
414 | - 'fields' => apply_filters( 'give_settings_display', array( |
|
412 | + 'give_title' => esc_html__('Display Settings', 'give'), |
|
413 | + 'show_on' => array('key' => 'options-page', 'value' => array($this->key)), |
|
414 | + 'fields' => apply_filters('give_settings_display', array( |
|
415 | 415 | array( |
416 | - 'name' => esc_html__( 'Display Settings', 'give' ), |
|
416 | + 'name' => esc_html__('Display Settings', 'give'), |
|
417 | 417 | 'desc' => '', |
418 | 418 | 'id' => 'give_title_display_settings_1', |
419 | 419 | 'type' => 'give_title', |
420 | 420 | ), |
421 | 421 | array( |
422 | - 'name' => esc_html__( 'Disable CSS', 'give' ), |
|
423 | - 'desc' => esc_html__( 'Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give' ), |
|
422 | + 'name' => esc_html__('Disable CSS', 'give'), |
|
423 | + 'desc' => esc_html__('Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give'), |
|
424 | 424 | 'id' => 'disable_css', |
425 | 425 | 'type' => 'checkbox', |
426 | 426 | ), |
427 | 427 | array( |
428 | - 'name' => esc_html__( 'Enable Floating Labels', 'give' ), |
|
428 | + 'name' => esc_html__('Enable Floating Labels', 'give'), |
|
429 | 429 | /* translators: %s: http://docs.givewp.com/form-floating-labels */ |
430 | - 'desc' => sprintf( wp_kses( __( 'Enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give' ), array( |
|
430 | + 'desc' => sprintf(wp_kses(__('Enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give'), array( |
|
431 | 431 | 'a' => array( |
432 | 432 | 'href' => array(), |
433 | 433 | 'target' => array(), |
434 | 434 | ), |
435 | - ) ), esc_url( 'http://docs.givewp.com/form-floating-labels' ) ), |
|
435 | + )), esc_url('http://docs.givewp.com/form-floating-labels')), |
|
436 | 436 | 'id' => 'floatlabels', |
437 | 437 | 'type' => 'checkbox', |
438 | 438 | ), |
439 | 439 | array( |
440 | - 'name' => esc_html__( 'Disable Welcome Screen', 'give' ), |
|
440 | + 'name' => esc_html__('Disable Welcome Screen', 'give'), |
|
441 | 441 | /* translators: %s: about page URL */ |
442 | - 'desc' => sprintf( wp_kses( __( 'Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> every time Give is activated and/or updated.', 'give' ), array( |
|
442 | + 'desc' => sprintf(wp_kses(__('Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> every time Give is activated and/or updated.', 'give'), array( |
|
443 | 443 | 'a' => array( |
444 | 444 | 'href' => array(), |
445 | 445 | 'target' => array(), |
446 | 446 | ), |
447 | - ) ), esc_url( admin_url( 'index.php?page=give-about' ) ) ), |
|
447 | + )), esc_url(admin_url('index.php?page=give-about'))), |
|
448 | 448 | 'id' => 'disable_welcome', |
449 | 449 | 'type' => 'checkbox', |
450 | 450 | ), |
451 | 451 | array( |
452 | - 'name' => esc_html__( 'Post Types', 'give' ), |
|
452 | + 'name' => esc_html__('Post Types', 'give'), |
|
453 | 453 | 'desc' => '', |
454 | 454 | 'id' => 'give_title_display_settings_2', |
455 | 455 | 'type' => 'give_title', |
456 | 456 | ), |
457 | 457 | array( |
458 | - 'name' => esc_html__( 'Disable Form Single Views', 'give' ), |
|
459 | - 'desc' => esc_html__( 'By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ), |
|
458 | + 'name' => esc_html__('Disable Form Single Views', 'give'), |
|
459 | + 'desc' => esc_html__('By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'), |
|
460 | 460 | 'id' => 'disable_forms_singular', |
461 | 461 | 'type' => 'checkbox', |
462 | 462 | ), |
463 | 463 | array( |
464 | - 'name' => esc_html__( 'Disable Form Archives', 'give' ), |
|
465 | - 'desc' => esc_html__( 'Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give' ), |
|
464 | + 'name' => esc_html__('Disable Form Archives', 'give'), |
|
465 | + 'desc' => esc_html__('Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give'), |
|
466 | 466 | 'id' => 'disable_forms_archives', |
467 | 467 | 'type' => 'checkbox', |
468 | 468 | ), |
469 | 469 | array( |
470 | - 'name' => esc_html__( 'Disable Form Excerpts', 'give' ), |
|
471 | - 'desc' => esc_html__( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ), |
|
470 | + 'name' => esc_html__('Disable Form Excerpts', 'give'), |
|
471 | + 'desc' => esc_html__('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'), |
|
472 | 472 | 'id' => 'disable_forms_excerpt', |
473 | 473 | 'type' => 'checkbox', |
474 | 474 | ), |
475 | 475 | array( |
476 | - 'name' => esc_html__( 'Featured Image Size', 'give' ), |
|
477 | - 'desc' => esc_html__( 'The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give' ), |
|
476 | + 'name' => esc_html__('Featured Image Size', 'give'), |
|
477 | + 'desc' => esc_html__('The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give'), |
|
478 | 478 | 'id' => 'featured_image_size', |
479 | 479 | 'type' => 'select', |
480 | 480 | 'default' => 'large', |
481 | 481 | 'options' => give_get_featured_image_sizes(), |
482 | 482 | ), |
483 | 483 | array( |
484 | - 'name' => esc_html__( 'Disable Form Featured Image', 'give' ), |
|
485 | - 'desc' => esc_html__( 'If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give' ), |
|
484 | + 'name' => esc_html__('Disable Form Featured Image', 'give'), |
|
485 | + 'desc' => esc_html__('If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give'), |
|
486 | 486 | 'id' => 'disable_form_featured_img', |
487 | 487 | 'type' => 'checkbox', |
488 | 488 | ), |
489 | 489 | array( |
490 | - 'name' => esc_html__( 'Disable Single Form Sidebar', 'give' ), |
|
491 | - 'desc' => esc_html__( 'The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ), |
|
490 | + 'name' => esc_html__('Disable Single Form Sidebar', 'give'), |
|
491 | + 'desc' => esc_html__('The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'), |
|
492 | 492 | 'id' => 'disable_form_sidebar', |
493 | 493 | 'type' => 'checkbox', |
494 | 494 | ), |
495 | 495 | array( |
496 | - 'name' => esc_html__( 'Taxonomies', 'give' ), |
|
496 | + 'name' => esc_html__('Taxonomies', 'give'), |
|
497 | 497 | 'desc' => '', |
498 | 498 | 'id' => 'give_title_display_settings_3', |
499 | 499 | 'type' => 'give_title', |
500 | 500 | ), |
501 | 501 | array( |
502 | - 'name' => esc_html__( 'Enable Form Categories', 'give' ), |
|
503 | - 'desc' => esc_html__( 'Enables the "Category" taxonomy for all Give forms.', 'give' ), |
|
502 | + 'name' => esc_html__('Enable Form Categories', 'give'), |
|
503 | + 'desc' => esc_html__('Enables the "Category" taxonomy for all Give forms.', 'give'), |
|
504 | 504 | 'id' => 'categories', |
505 | 505 | 'type' => 'checkbox', |
506 | 506 | ), |
507 | 507 | array( |
508 | - 'name' => esc_html__( 'Enable Form Tags', 'give' ), |
|
509 | - 'desc' => esc_html__( 'Enables the "Tag" taxonomy for all Give forms.', 'give' ), |
|
508 | + 'name' => esc_html__('Enable Form Tags', 'give'), |
|
509 | + 'desc' => esc_html__('Enables the "Tag" taxonomy for all Give forms.', 'give'), |
|
510 | 510 | 'id' => 'tags', |
511 | 511 | 'type' => 'checkbox', |
512 | 512 | ), |
@@ -519,101 +519,101 @@ discard block |
||
519 | 519 | */ |
520 | 520 | 'emails' => array( |
521 | 521 | 'id' => 'email_settings', |
522 | - 'give_title' => esc_html__( 'Email Settings', 'give' ), |
|
523 | - 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key ) ), |
|
524 | - 'fields' => apply_filters( 'give_settings_emails', array( |
|
522 | + 'give_title' => esc_html__('Email Settings', 'give'), |
|
523 | + 'show_on' => array('key' => 'options-page', 'value' => array($this->key)), |
|
524 | + 'fields' => apply_filters('give_settings_emails', array( |
|
525 | 525 | array( |
526 | - 'name' => esc_html__( 'Email Settings', 'give' ), |
|
526 | + 'name' => esc_html__('Email Settings', 'give'), |
|
527 | 527 | 'desc' => '', |
528 | 528 | 'id' => 'give_title_email_settings_1', |
529 | 529 | 'type' => 'give_title', |
530 | 530 | ), |
531 | 531 | array( |
532 | 532 | 'id' => 'email_template', |
533 | - 'name' => esc_html__( 'Email Template', 'give' ), |
|
534 | - 'desc' => esc_html__( 'Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give' ), |
|
533 | + 'name' => esc_html__('Email Template', 'give'), |
|
534 | + 'desc' => esc_html__('Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give'), |
|
535 | 535 | 'type' => 'select', |
536 | 536 | 'options' => give_get_email_templates(), |
537 | 537 | ), |
538 | 538 | array( |
539 | 539 | 'id' => 'email_logo', |
540 | - 'name' => esc_html__( 'Logo', 'give' ), |
|
541 | - 'desc' => esc_html__( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ), |
|
540 | + 'name' => esc_html__('Logo', 'give'), |
|
541 | + 'desc' => esc_html__('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'), |
|
542 | 542 | 'type' => 'file', |
543 | 543 | ), |
544 | 544 | array( |
545 | 545 | 'id' => 'from_name', |
546 | - 'name' => esc_html__( 'From Name', 'give' ), |
|
547 | - 'desc' => esc_html__( 'The name that appears in the "From" field in donation receipt emails.', 'give' ), |
|
548 | - 'default' => get_bloginfo( 'name' ), |
|
546 | + 'name' => esc_html__('From Name', 'give'), |
|
547 | + 'desc' => esc_html__('The name that appears in the "From" field in donation receipt emails.', 'give'), |
|
548 | + 'default' => get_bloginfo('name'), |
|
549 | 549 | 'type' => 'text', |
550 | 550 | ), |
551 | 551 | array( |
552 | 552 | 'id' => 'from_email', |
553 | - 'name' => esc_html__( 'From Email', 'give' ), |
|
554 | - 'desc' => esc_html__( 'Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give' ), |
|
555 | - 'default' => get_bloginfo( 'admin_email' ), |
|
553 | + 'name' => esc_html__('From Email', 'give'), |
|
554 | + 'desc' => esc_html__('Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give'), |
|
555 | + 'default' => get_bloginfo('admin_email'), |
|
556 | 556 | 'type' => 'text', |
557 | 557 | ), |
558 | 558 | array( |
559 | - 'name' => esc_html__( 'Donation Receipt', 'give' ), |
|
559 | + 'name' => esc_html__('Donation Receipt', 'give'), |
|
560 | 560 | 'desc' => '', |
561 | 561 | 'id' => 'give_title_email_settings_2', |
562 | 562 | 'type' => 'give_title', |
563 | 563 | ), |
564 | 564 | array( |
565 | 565 | 'id' => 'donation_subject', |
566 | - 'name' => esc_html__( 'Donation Email Subject', 'give' ), |
|
567 | - 'desc' => esc_html__( 'Enter the subject line for the donation receipt email.', 'give' ), |
|
568 | - 'default' => esc_attr__( 'Donation Receipt', 'give' ), |
|
566 | + 'name' => esc_html__('Donation Email Subject', 'give'), |
|
567 | + 'desc' => esc_html__('Enter the subject line for the donation receipt email.', 'give'), |
|
568 | + 'default' => esc_attr__('Donation Receipt', 'give'), |
|
569 | 569 | 'type' => 'text', |
570 | 570 | ), |
571 | 571 | array( |
572 | 572 | 'id' => 'donation_receipt', |
573 | - 'name' => esc_html__( 'Donation Receipt', 'give' ), |
|
573 | + 'name' => esc_html__('Donation Receipt', 'give'), |
|
574 | 574 | 'desc' => sprintf( |
575 | 575 | /* translators: %s: emails tags list */ |
576 | - esc_html__( 'Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give' ), |
|
577 | - '<br/>' . give_get_emails_tags_list() |
|
576 | + esc_html__('Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give'), |
|
577 | + '<br/>'.give_get_emails_tags_list() |
|
578 | 578 | ), |
579 | 579 | 'type' => 'wysiwyg', |
580 | 580 | 'default' => give_get_default_donation_receipt_email(), |
581 | 581 | ), |
582 | 582 | array( |
583 | - 'name' => esc_html__( 'New Donation Notification', 'give' ), |
|
583 | + 'name' => esc_html__('New Donation Notification', 'give'), |
|
584 | 584 | 'desc' => '', |
585 | 585 | 'id' => 'give_title_email_settings_3', |
586 | 586 | 'type' => 'give_title', |
587 | 587 | ), |
588 | 588 | array( |
589 | 589 | 'id' => 'donation_notification_subject', |
590 | - 'name' => esc_html__( 'Donation Notification Subject', 'give' ), |
|
591 | - 'desc' => esc_html__( 'Enter the subject line for the donation notification email.', 'give' ), |
|
590 | + 'name' => esc_html__('Donation Notification Subject', 'give'), |
|
591 | + 'desc' => esc_html__('Enter the subject line for the donation notification email.', 'give'), |
|
592 | 592 | 'type' => 'text', |
593 | - 'default' => esc_attr__( 'New Donation - #{payment_id}', 'give' ), |
|
593 | + 'default' => esc_attr__('New Donation - #{payment_id}', 'give'), |
|
594 | 594 | ), |
595 | 595 | array( |
596 | 596 | 'id' => 'donation_notification', |
597 | - 'name' => esc_html__( 'Donation Notification', 'give' ), |
|
597 | + 'name' => esc_html__('Donation Notification', 'give'), |
|
598 | 598 | 'desc' => sprintf( |
599 | 599 | /* translators: %s: emails tags list */ |
600 | - esc_html__( 'Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give' ), |
|
601 | - '<br/>' . give_get_emails_tags_list() |
|
600 | + esc_html__('Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give'), |
|
601 | + '<br/>'.give_get_emails_tags_list() |
|
602 | 602 | ), |
603 | 603 | 'type' => 'wysiwyg', |
604 | 604 | 'default' => give_get_default_donation_notification_email(), |
605 | 605 | ), |
606 | 606 | array( |
607 | 607 | 'id' => 'admin_notice_emails', |
608 | - 'name' => esc_html__( 'Donation Notification Emails', 'give' ), |
|
609 | - 'desc' => __( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give' ), |
|
608 | + 'name' => esc_html__('Donation Notification Emails', 'give'), |
|
609 | + 'desc' => __('Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give'), |
|
610 | 610 | 'type' => 'textarea', |
611 | - 'default' => get_bloginfo( 'admin_email' ), |
|
611 | + 'default' => get_bloginfo('admin_email'), |
|
612 | 612 | ), |
613 | 613 | array( |
614 | 614 | 'id' => 'disable_admin_notices', |
615 | - 'name' => esc_html__( 'Disable Admin Notifications', 'give' ), |
|
616 | - 'desc' => esc_html__( 'Check this box if you do not want to receive emails when new donations are made.', 'give' ), |
|
615 | + 'name' => esc_html__('Disable Admin Notifications', 'give'), |
|
616 | + 'desc' => esc_html__('Check this box if you do not want to receive emails when new donations are made.', 'give'), |
|
617 | 617 | 'type' => 'checkbox', |
618 | 618 | ), |
619 | 619 | ) |
@@ -622,99 +622,99 @@ discard block |
||
622 | 622 | /** Extension Settings */ |
623 | 623 | 'addons' => array( |
624 | 624 | 'id' => 'addons', |
625 | - 'give_title' => esc_html__( 'Give Add-ons Settings', 'give' ), |
|
626 | - 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key ) ), |
|
627 | - 'fields' => apply_filters( 'give_settings_addons', array() |
|
625 | + 'give_title' => esc_html__('Give Add-ons Settings', 'give'), |
|
626 | + 'show_on' => array('key' => 'options-page', 'value' => array($this->key)), |
|
627 | + 'fields' => apply_filters('give_settings_addons', array() |
|
628 | 628 | ), |
629 | 629 | ), |
630 | 630 | /** Licenses Settings */ |
631 | 631 | 'licenses' => array( |
632 | 632 | 'id' => 'licenses', |
633 | - 'give_title' => esc_html__( 'Give Licenses', 'give' ), |
|
634 | - 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key ) ), |
|
635 | - 'fields' => apply_filters( 'give_settings_licenses', array() |
|
633 | + 'give_title' => esc_html__('Give Licenses', 'give'), |
|
634 | + 'show_on' => array('key' => 'options-page', 'value' => array($this->key)), |
|
635 | + 'fields' => apply_filters('give_settings_licenses', array() |
|
636 | 636 | ), |
637 | 637 | ), |
638 | 638 | /** Advanced Options */ |
639 | 639 | 'advanced' => array( |
640 | 640 | 'id' => 'advanced_options', |
641 | - 'give_title' => esc_html__( 'Advanced Options', 'give' ), |
|
642 | - 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key ) ), |
|
643 | - 'fields' => apply_filters( 'give_settings_advanced', array( |
|
641 | + 'give_title' => esc_html__('Advanced Options', 'give'), |
|
642 | + 'show_on' => array('key' => 'options-page', 'value' => array($this->key)), |
|
643 | + 'fields' => apply_filters('give_settings_advanced', array( |
|
644 | 644 | array( |
645 | - 'name' => esc_html__( 'Access Control', 'give' ), |
|
645 | + 'name' => esc_html__('Access Control', 'give'), |
|
646 | 646 | 'desc' => '', |
647 | 647 | 'id' => 'give_title_session_control_1', |
648 | 648 | 'type' => 'give_title', |
649 | 649 | ), |
650 | 650 | array( |
651 | 651 | 'id' => 'session_lifetime', |
652 | - 'name' => esc_html__( 'Session Lifetime', 'give' ), |
|
653 | - 'desc' => esc_html__( 'The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give' ), |
|
652 | + 'name' => esc_html__('Session Lifetime', 'give'), |
|
653 | + 'desc' => esc_html__('The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give'), |
|
654 | 654 | 'type' => 'select', |
655 | 655 | 'options' => array( |
656 | - '86400' => esc_html__( '24 Hours', 'give' ), |
|
657 | - '172800' => esc_html__( '48 Hours', 'give' ), |
|
658 | - '259200' => esc_html__( '72 Hours', 'give' ), |
|
659 | - '604800' => esc_html__( '1 Week', 'give' ), |
|
656 | + '86400' => esc_html__('24 Hours', 'give'), |
|
657 | + '172800' => esc_html__('48 Hours', 'give'), |
|
658 | + '259200' => esc_html__('72 Hours', 'give'), |
|
659 | + '604800' => esc_html__('1 Week', 'give'), |
|
660 | 660 | ), |
661 | 661 | ), |
662 | 662 | array( |
663 | - 'name' => esc_html__( 'Email Access', 'give' ), |
|
664 | - 'desc' => esc_html__( 'Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give' ), |
|
663 | + 'name' => esc_html__('Email Access', 'give'), |
|
664 | + 'desc' => esc_html__('Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give'), |
|
665 | 665 | 'id' => 'email_access', |
666 | 666 | 'type' => 'checkbox', |
667 | 667 | ), |
668 | 668 | array( |
669 | 669 | 'id' => 'recaptcha_key', |
670 | - 'name' => esc_html__( 'reCAPTCHA Site Key', 'give' ), |
|
670 | + 'name' => esc_html__('reCAPTCHA Site Key', 'give'), |
|
671 | 671 | /* translators: %s: https://www.google.com/recaptcha/ */ |
672 | - 'desc' => sprintf( __( 'If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give' ), esc_url( 'https://www.google.com/recaptcha/' ) ), |
|
672 | + 'desc' => sprintf(__('If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give'), esc_url('https://www.google.com/recaptcha/')), |
|
673 | 673 | 'default' => '', |
674 | 674 | 'type' => 'text', |
675 | 675 | ), |
676 | 676 | array( |
677 | 677 | 'id' => 'recaptcha_secret', |
678 | - 'name' => esc_html__( 'reCAPTCHA Secret Key', 'give' ), |
|
679 | - 'desc' => esc_html__( 'Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give' ), |
|
678 | + 'name' => esc_html__('reCAPTCHA Secret Key', 'give'), |
|
679 | + 'desc' => esc_html__('Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give'), |
|
680 | 680 | 'default' => '', |
681 | 681 | 'type' => 'text', |
682 | 682 | ), |
683 | 683 | array( |
684 | - 'name' => esc_html__( 'Data Control', 'give' ), |
|
684 | + 'name' => esc_html__('Data Control', 'give'), |
|
685 | 685 | 'desc' => '', |
686 | 686 | 'id' => 'give_title_data_control_2', |
687 | 687 | 'type' => 'give_title', |
688 | 688 | ), |
689 | 689 | array( |
690 | - 'name' => esc_html__( 'Remove All Data on Uninstall?', 'give' ), |
|
691 | - 'desc' => esc_html__( 'When the plugin is deleted, completely remove all Give data.', 'give' ), |
|
690 | + 'name' => esc_html__('Remove All Data on Uninstall?', 'give'), |
|
691 | + 'desc' => esc_html__('When the plugin is deleted, completely remove all Give data.', 'give'), |
|
692 | 692 | 'id' => 'uninstall_on_delete', |
693 | 693 | 'type' => 'checkbox', |
694 | 694 | ), |
695 | 695 | array( |
696 | - 'name' => esc_html__( 'Filter Control', 'give' ), |
|
696 | + 'name' => esc_html__('Filter Control', 'give'), |
|
697 | 697 | 'desc' => '', |
698 | 698 | 'id' => 'give_title_filter_control', |
699 | 699 | 'type' => 'give_title', |
700 | 700 | ), |
701 | 701 | array( |
702 | 702 | /* translators: %s: the_content */ |
703 | - 'name' => sprintf( __( 'Disable %s filter', 'give' ), '<code>the_content</code>' ), |
|
703 | + 'name' => sprintf(__('Disable %s filter', 'give'), '<code>the_content</code>'), |
|
704 | 704 | /* translators: 1: https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content 2: the_content */ |
705 | - 'desc' => sprintf( __( 'If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give' ), esc_url( 'https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content' ), '<code>the_content</code>' ), |
|
705 | + 'desc' => sprintf(__('If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give'), esc_url('https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content'), '<code>the_content</code>'), |
|
706 | 706 | 'id' => 'disable_the_content_filter', |
707 | 707 | 'type' => 'checkbox', |
708 | 708 | ), |
709 | 709 | array( |
710 | - 'name' => esc_html__( 'Script Loading', 'give' ), |
|
710 | + 'name' => esc_html__('Script Loading', 'give'), |
|
711 | 711 | 'desc' => '', |
712 | 712 | 'id' => 'give_title_script_control', |
713 | 713 | 'type' => 'give_title', |
714 | 714 | ), |
715 | 715 | array( |
716 | - 'name' => esc_html__( 'Load Scripts in Footer?', 'give' ), |
|
717 | - 'desc' => esc_html__( 'Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give' ), |
|
716 | + 'name' => esc_html__('Load Scripts in Footer?', 'give'), |
|
717 | + 'desc' => esc_html__('Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give'), |
|
718 | 718 | 'id' => 'scripts_footer', |
719 | 719 | 'type' => 'checkbox', |
720 | 720 | ), |
@@ -724,13 +724,13 @@ discard block |
||
724 | 724 | /** API Settings */ |
725 | 725 | 'api' => array( |
726 | 726 | 'id' => 'api', |
727 | - 'give_title' => esc_html__( 'API', 'give' ), |
|
728 | - 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key ) ), |
|
727 | + 'give_title' => esc_html__('API', 'give'), |
|
728 | + 'show_on' => array('key' => 'options-page', 'value' => array($this->key)), |
|
729 | 729 | 'show_names' => false, // Hide field names on the left |
730 | - 'fields' => apply_filters( 'give_settings_system', array( |
|
730 | + 'fields' => apply_filters('give_settings_system', array( |
|
731 | 731 | array( |
732 | 732 | 'id' => 'api', |
733 | - 'name' => esc_html__( 'API', 'give' ), |
|
733 | + 'name' => esc_html__('API', 'give'), |
|
734 | 734 | 'type' => 'api', |
735 | 735 | ), |
736 | 736 | ) |
@@ -739,13 +739,13 @@ discard block |
||
739 | 739 | /** Licenses Settings */ |
740 | 740 | 'system_info' => array( |
741 | 741 | 'id' => 'system_info', |
742 | - 'give_title' => esc_html__( 'System Info', 'give' ), |
|
743 | - 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key ) ), |
|
744 | - 'fields' => apply_filters( 'give_settings_system', array( |
|
742 | + 'give_title' => esc_html__('System Info', 'give'), |
|
743 | + 'show_on' => array('key' => 'options-page', 'value' => array($this->key)), |
|
744 | + 'fields' => apply_filters('give_settings_system', array( |
|
745 | 745 | array( |
746 | 746 | 'id' => 'system-info-textarea', |
747 | - 'name' => esc_html__( 'System Info', 'give' ), |
|
748 | - 'desc' => esc_html__( 'Please copy and paste this information in your ticket when contacting support.', 'give' ), |
|
747 | + 'name' => esc_html__('System Info', 'give'), |
|
748 | + 'desc' => esc_html__('Please copy and paste this information in your ticket when contacting support.', 'give'), |
|
749 | 749 | 'type' => 'system_info', |
750 | 750 | ), |
751 | 751 | ) |
@@ -753,15 +753,15 @@ discard block |
||
753 | 753 | ), |
754 | 754 | ); |
755 | 755 | |
756 | - $give_settings = apply_filters( 'give_registered_settings', $give_settings ); |
|
756 | + $give_settings = apply_filters('give_registered_settings', $give_settings); |
|
757 | 757 | |
758 | 758 | // Return all settings array if no active tab |
759 | - if ( empty( $active_tab ) || ! isset( $give_settings[ $active_tab ] ) ) { |
|
759 | + if (empty($active_tab) || ! isset($give_settings[$active_tab])) { |
|
760 | 760 | return $give_settings; |
761 | 761 | } |
762 | 762 | |
763 | 763 | // Add other tabs and settings fields as needed |
764 | - return $give_settings[ $active_tab ]; |
|
764 | + return $give_settings[$active_tab]; |
|
765 | 765 | |
766 | 766 | } |
767 | 767 | |
@@ -770,11 +770,11 @@ discard block |
||
770 | 770 | */ |
771 | 771 | public function settings_notices() { |
772 | 772 | |
773 | - if ( ! isset( $_POST['give_settings_saved'] ) ) { |
|
773 | + if ( ! isset($_POST['give_settings_saved'])) { |
|
774 | 774 | return; |
775 | 775 | } |
776 | 776 | |
777 | - add_settings_error( 'give-notices', 'global-settings-updated', esc_html__( 'Settings updated.', 'give' ), 'updated' ); |
|
777 | + add_settings_error('give-notices', 'global-settings-updated', esc_html__('Settings updated.', 'give'), 'updated'); |
|
778 | 778 | |
779 | 779 | } |
780 | 780 | |
@@ -789,14 +789,14 @@ discard block |
||
789 | 789 | * @return mixed Field value or exception is thrown. |
790 | 790 | * @throws Exception Throws an exception if the field is invalid. |
791 | 791 | */ |
792 | - public function __get( $field ) { |
|
792 | + public function __get($field) { |
|
793 | 793 | |
794 | 794 | // Allowed fields to retrieve |
795 | - if ( in_array( $field, array( 'key', 'fields', 'give_title', 'options_page' ), true ) ) { |
|
795 | + if (in_array($field, array('key', 'fields', 'give_title', 'options_page'), true)) { |
|
796 | 796 | return $this->{$field}; |
797 | 797 | } |
798 | 798 | |
799 | - throw new Exception( sprintf( esc_html__( 'Invalid property: %s', 'give' ), $field ) ); |
|
799 | + throw new Exception(sprintf(esc_html__('Invalid property: %s', 'give'), $field)); |
|
800 | 800 | } |
801 | 801 | |
802 | 802 | |
@@ -815,12 +815,12 @@ discard block |
||
815 | 815 | * |
816 | 816 | * @return mixed Option value |
817 | 817 | */ |
818 | -function give_get_option( $key = '', $default = false ) { |
|
818 | +function give_get_option($key = '', $default = false) { |
|
819 | 819 | $give_options = give_get_settings(); |
820 | - $value = ! empty( $give_options[ $key ] ) ? $give_options[ $key ] : $default; |
|
821 | - $value = apply_filters( 'give_get_option', $value, $key, $default ); |
|
820 | + $value = ! empty($give_options[$key]) ? $give_options[$key] : $default; |
|
821 | + $value = apply_filters('give_get_option', $value, $key, $default); |
|
822 | 822 | |
823 | - return apply_filters( "give_get_option_{$key}", $value, $key, $default ); |
|
823 | + return apply_filters("give_get_option_{$key}", $value, $key, $default); |
|
824 | 824 | } |
825 | 825 | |
826 | 826 | |
@@ -838,33 +838,33 @@ discard block |
||
838 | 838 | * |
839 | 839 | * @return boolean True if updated, false if not. |
840 | 840 | */ |
841 | -function give_update_option( $key = '', $value = false ) { |
|
841 | +function give_update_option($key = '', $value = false) { |
|
842 | 842 | |
843 | 843 | // If no key, exit |
844 | - if ( empty( $key ) ) { |
|
844 | + if (empty($key)) { |
|
845 | 845 | return false; |
846 | 846 | } |
847 | 847 | |
848 | - if ( empty( $value ) ) { |
|
849 | - $remove_option = give_delete_option( $key ); |
|
848 | + if (empty($value)) { |
|
849 | + $remove_option = give_delete_option($key); |
|
850 | 850 | |
851 | 851 | return $remove_option; |
852 | 852 | } |
853 | 853 | |
854 | 854 | // First let's grab the current settings |
855 | - $options = get_option( 'give_settings' ); |
|
855 | + $options = get_option('give_settings'); |
|
856 | 856 | |
857 | 857 | // Let's let devs alter that value coming in |
858 | - $value = apply_filters( 'give_update_option', $value, $key ); |
|
858 | + $value = apply_filters('give_update_option', $value, $key); |
|
859 | 859 | |
860 | 860 | // Next let's try to update the value |
861 | - $options[ $key ] = $value; |
|
862 | - $did_update = update_option( 'give_settings', $options ); |
|
861 | + $options[$key] = $value; |
|
862 | + $did_update = update_option('give_settings', $options); |
|
863 | 863 | |
864 | 864 | // If it updated, let's update the global variable |
865 | - if ( $did_update ) { |
|
865 | + if ($did_update) { |
|
866 | 866 | global $give_options; |
867 | - $give_options[ $key ] = $value; |
|
867 | + $give_options[$key] = $value; |
|
868 | 868 | } |
869 | 869 | |
870 | 870 | return $did_update; |
@@ -883,25 +883,25 @@ discard block |
||
883 | 883 | * |
884 | 884 | * @return boolean True if updated, false if not. |
885 | 885 | */ |
886 | -function give_delete_option( $key = '' ) { |
|
886 | +function give_delete_option($key = '') { |
|
887 | 887 | |
888 | 888 | // If no key, exit |
889 | - if ( empty( $key ) ) { |
|
889 | + if (empty($key)) { |
|
890 | 890 | return false; |
891 | 891 | } |
892 | 892 | |
893 | 893 | // First let's grab the current settings |
894 | - $options = get_option( 'give_settings' ); |
|
894 | + $options = get_option('give_settings'); |
|
895 | 895 | |
896 | 896 | // Next let's try to update the value |
897 | - if ( isset( $options[ $key ] ) ) { |
|
898 | - unset( $options[ $key ] ); |
|
897 | + if (isset($options[$key])) { |
|
898 | + unset($options[$key]); |
|
899 | 899 | } |
900 | 900 | |
901 | - $did_update = update_option( 'give_settings', $options ); |
|
901 | + $did_update = update_option('give_settings', $options); |
|
902 | 902 | |
903 | 903 | // If it updated, let's update the global variable |
904 | - if ( $did_update ) { |
|
904 | + if ($did_update) { |
|
905 | 905 | global $give_options; |
906 | 906 | $give_options = $options; |
907 | 907 | } |
@@ -920,9 +920,9 @@ discard block |
||
920 | 920 | */ |
921 | 921 | function give_get_settings() { |
922 | 922 | |
923 | - $settings = get_option( 'give_settings' ); |
|
923 | + $settings = get_option('give_settings'); |
|
924 | 924 | |
925 | - return (array) apply_filters( 'give_get_settings', $settings ); |
|
925 | + return (array) apply_filters('give_get_settings', $settings); |
|
926 | 926 | |
927 | 927 | } |
928 | 928 | |
@@ -940,25 +940,25 @@ discard block |
||
940 | 940 | * |
941 | 941 | * @return array |
942 | 942 | */ |
943 | -function give_settings_array_insert( $array, $position, $insert ) { |
|
944 | - if ( is_int( $position ) ) { |
|
945 | - array_splice( $array, $position, 0, $insert ); |
|
943 | +function give_settings_array_insert($array, $position, $insert) { |
|
944 | + if (is_int($position)) { |
|
945 | + array_splice($array, $position, 0, $insert); |
|
946 | 946 | } else { |
947 | 947 | |
948 | - foreach ( $array as $index => $subarray ) { |
|
949 | - if ( isset( $subarray['id'] ) && $subarray['id'] == $position ) { |
|
948 | + foreach ($array as $index => $subarray) { |
|
949 | + if (isset($subarray['id']) && $subarray['id'] == $position) { |
|
950 | 950 | $pos = $index; |
951 | 951 | } |
952 | 952 | } |
953 | 953 | |
954 | - if ( ! isset( $pos ) ) { |
|
954 | + if ( ! isset($pos)) { |
|
955 | 955 | return $array; |
956 | 956 | } |
957 | 957 | |
958 | 958 | $array = array_merge( |
959 | - array_slice( $array, 0, $pos ), |
|
959 | + array_slice($array, 0, $pos), |
|
960 | 960 | $insert, |
961 | - array_slice( $array, $pos ) |
|
961 | + array_slice($array, $pos) |
|
962 | 962 | ); |
963 | 963 | } |
964 | 964 | |
@@ -978,23 +978,23 @@ discard block |
||
978 | 978 | * |
979 | 979 | * @return void |
980 | 980 | */ |
981 | -function give_enabled_gateways_callback( $field_arr, $saved_values = array() ) { |
|
981 | +function give_enabled_gateways_callback($field_arr, $saved_values = array()) { |
|
982 | 982 | |
983 | 983 | $id = $field_arr['id']; |
984 | - $gateways = give_get_ordered_payment_gateways( give_get_payment_gateways() ); |
|
984 | + $gateways = give_get_ordered_payment_gateways(give_get_payment_gateways()); |
|
985 | 985 | |
986 | 986 | echo '<ul class="give-checklist-fields give-payment-gatways-list">'; |
987 | 987 | |
988 | - foreach ( $gateways as $key => $option ) : |
|
988 | + foreach ($gateways as $key => $option) : |
|
989 | 989 | |
990 | - if ( is_array( $saved_values ) && array_key_exists( $key, $saved_values ) ) { |
|
990 | + if (is_array($saved_values) && array_key_exists($key, $saved_values)) { |
|
991 | 991 | $enabled = '1'; |
992 | 992 | } else { |
993 | 993 | $enabled = null; |
994 | 994 | } |
995 | 995 | |
996 | - echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="' . $id . '[' . $key . ']" id="' . $id . '[' . $key . ']" type="checkbox" value="1" ' . checked( '1', $enabled, false ) . '/> '; |
|
997 | - echo '<label for="' . $id . '[' . $key . ']">' . $option['admin_label'] . '</label></li>'; |
|
996 | + echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="'.$id.'['.$key.']" id="'.$id.'['.$key.']" type="checkbox" value="1" '.checked('1', $enabled, false).'/> '; |
|
997 | + echo '<label for="'.$id.'['.$key.']">'.$option['admin_label'].'</label></li>'; |
|
998 | 998 | |
999 | 999 | endforeach; |
1000 | 1000 | |
@@ -1013,16 +1013,16 @@ discard block |
||
1013 | 1013 | * |
1014 | 1014 | * @return void |
1015 | 1015 | */ |
1016 | -function give_default_gateway_callback( $field_arr, $saved_value ) { |
|
1016 | +function give_default_gateway_callback($field_arr, $saved_value) { |
|
1017 | 1017 | $id = $field_arr['id']; |
1018 | 1018 | $gateways = give_get_enabled_payment_gateways(); |
1019 | - $saved_value = give_get_default_gateway( null ); |
|
1019 | + $saved_value = give_get_default_gateway(null); |
|
1020 | 1020 | |
1021 | - echo '<select class="give-select" name="' . $id . '" id="' . $id . '">'; |
|
1021 | + echo '<select class="give-select" name="'.$id.'" id="'.$id.'">'; |
|
1022 | 1022 | |
1023 | - foreach ( $gateways as $key => $option ) : |
|
1024 | - $selected = isset( $saved_value ) ? selected( $key, $saved_value, false ) : ''; |
|
1025 | - echo '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option['admin_label'] ) . '</option>'; |
|
1023 | + foreach ($gateways as $key => $option) : |
|
1024 | + $selected = isset($saved_value) ? selected($key, $saved_value, false) : ''; |
|
1025 | + echo '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option['admin_label']).'</option>'; |
|
1026 | 1026 | endforeach; |
1027 | 1027 | |
1028 | 1028 | echo '</select>'; |
@@ -1040,13 +1040,13 @@ discard block |
||
1040 | 1040 | * |
1041 | 1041 | * @return void |
1042 | 1042 | */ |
1043 | -function give_title_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) { |
|
1043 | +function give_title_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) { |
|
1044 | 1044 | |
1045 | 1045 | $id = $field_type_object->field->args['id']; |
1046 | 1046 | $title = $field_type_object->field->args['name']; |
1047 | 1047 | $field_description = $field_type_object->field->args['desc']; |
1048 | 1048 | |
1049 | - echo '<hr>' . $field_description; |
|
1049 | + echo '<hr>'.$field_description; |
|
1050 | 1050 | |
1051 | 1051 | } |
1052 | 1052 | |
@@ -1061,7 +1061,7 @@ discard block |
||
1061 | 1061 | * |
1062 | 1062 | * @return void |
1063 | 1063 | */ |
1064 | -function give_description_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) { |
|
1064 | +function give_description_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) { |
|
1065 | 1065 | |
1066 | 1066 | $id = $field_type_object->field->args['id']; |
1067 | 1067 | $title = $field_type_object->field->args['name']; |
@@ -1080,25 +1080,25 @@ discard block |
||
1080 | 1080 | * @see: https://github.com/WebDevStudios/CMB2/wiki/Adding-your-own-field-types |
1081 | 1081 | * @return array An array of options that matches the CMB2 options array |
1082 | 1082 | */ |
1083 | -function give_cmb2_get_post_options( $query_args, $force = false ) { |
|
1083 | +function give_cmb2_get_post_options($query_args, $force = false) { |
|
1084 | 1084 | |
1085 | - $post_options = array( '' => '' ); // Blank option |
|
1085 | + $post_options = array('' => ''); // Blank option |
|
1086 | 1086 | |
1087 | - if ( ( ! isset( $_GET['page'] ) || 'give-settings' != $_GET['page'] ) && ! $force ) { |
|
1087 | + if (( ! isset($_GET['page']) || 'give-settings' != $_GET['page']) && ! $force) { |
|
1088 | 1088 | return $post_options; |
1089 | 1089 | } |
1090 | 1090 | |
1091 | - $args = wp_parse_args( $query_args, array( |
|
1091 | + $args = wp_parse_args($query_args, array( |
|
1092 | 1092 | 'post_type' => 'page', |
1093 | 1093 | 'numberposts' => 10, |
1094 | - ) ); |
|
1094 | + )); |
|
1095 | 1095 | |
1096 | - $posts = get_posts( $args ); |
|
1096 | + $posts = get_posts($args); |
|
1097 | 1097 | |
1098 | - if ( $posts ) { |
|
1099 | - foreach ( $posts as $post ) { |
|
1098 | + if ($posts) { |
|
1099 | + foreach ($posts as $post) { |
|
1100 | 1100 | |
1101 | - $post_options[ $post->ID ] = $post->post_title; |
|
1101 | + $post_options[$post->ID] = $post->post_title; |
|
1102 | 1102 | |
1103 | 1103 | } |
1104 | 1104 | } |
@@ -1124,20 +1124,20 @@ discard block |
||
1124 | 1124 | $get_sizes = get_intermediate_image_sizes(); |
1125 | 1125 | |
1126 | 1126 | // check whether intermediate image sizes exist first |
1127 | - if ( empty( $get_sizes ) ) { |
|
1128 | - $get_sizes = array( 'thumbnail', 'medium', 'medium_large', 'large' ); |
|
1127 | + if (empty($get_sizes)) { |
|
1128 | + $get_sizes = array('thumbnail', 'medium', 'medium_large', 'large'); |
|
1129 | 1129 | } |
1130 | 1130 | |
1131 | - foreach ( $get_sizes as $_size ) { |
|
1131 | + foreach ($get_sizes as $_size) { |
|
1132 | 1132 | |
1133 | - if ( in_array( $_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) { |
|
1134 | - $sizes[ $_size ] = $_size . ' - ' . get_option( "{$_size}_size_w" ) . 'x' . get_option( "{$_size}_size_h" ); |
|
1135 | - } elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) { |
|
1136 | - $sizes[ $_size ] = $_size . ' - ' . $_wp_additional_image_sizes[ $_size ]['width'] . 'x' . $_wp_additional_image_sizes[ $_size ]['height']; |
|
1133 | + if (in_array($_size, array('thumbnail', 'medium', 'medium_large', 'large'))) { |
|
1134 | + $sizes[$_size] = $_size.' - '.get_option("{$_size}_size_w").'x'.get_option("{$_size}_size_h"); |
|
1135 | + } elseif (isset($_wp_additional_image_sizes[$_size])) { |
|
1136 | + $sizes[$_size] = $_size.' - '.$_wp_additional_image_sizes[$_size]['width'].'x'.$_wp_additional_image_sizes[$_size]['height']; |
|
1137 | 1137 | } |
1138 | 1138 | } |
1139 | 1139 | |
1140 | - return apply_filters( 'give_get_featured_image_sizes', $sizes ); |
|
1140 | + return apply_filters('give_get_featured_image_sizes', $sizes); |
|
1141 | 1141 | } |
1142 | 1142 | |
1143 | 1143 | |
@@ -1152,18 +1152,18 @@ discard block |
||
1152 | 1152 | * |
1153 | 1153 | * @return void |
1154 | 1154 | */ |
1155 | -function give_license_key_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) { |
|
1155 | +function give_license_key_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) { |
|
1156 | 1156 | /* @var CMB2_Types $field_type_object */ |
1157 | 1157 | |
1158 | 1158 | $id = $field_type_object->field->args['id']; |
1159 | 1159 | $field_description = $field_type_object->field->args['desc']; |
1160 | 1160 | $license = $field_type_object->field->args['options']['license']; |
1161 | 1161 | $license_key = $escaped_value; |
1162 | - $is_license_key = apply_filters( 'give_is_license_key', ( is_object( $license ) && ! empty( $license ) ) ); |
|
1163 | - $is_valid_license = apply_filters( 'give_is_valid_license', ( $is_license_key && property_exists( $license, 'license' ) && 'valid' === $license->license ) ); |
|
1162 | + $is_license_key = apply_filters('give_is_license_key', (is_object($license) && ! empty($license))); |
|
1163 | + $is_valid_license = apply_filters('give_is_valid_license', ($is_license_key && property_exists($license, 'license') && 'valid' === $license->license)); |
|
1164 | 1164 | $shortname = $field_type_object->field->args['options']['shortname']; |
1165 | 1165 | $field_classes = 'regular-text give-license-field'; |
1166 | - $type = empty( $escaped_value ) || ! $is_valid_license ? 'text' : 'password'; |
|
1166 | + $type = empty($escaped_value) || ! $is_valid_license ? 'text' : 'password'; |
|
1167 | 1167 | $custom_html = ''; |
1168 | 1168 | $messages = array(); |
1169 | 1169 | $class = ''; |
@@ -1175,135 +1175,135 @@ discard block |
||
1175 | 1175 | |
1176 | 1176 | // By default query on edd api url will return license object which contain status and message property, this can break below functionality. |
1177 | 1177 | // To combat that check if status is set to error or not, if yes then set $is_license_key to false. |
1178 | - if ( $is_license_key && property_exists( $license, 'status' ) && 'error' === $license->status ) { |
|
1178 | + if ($is_license_key && property_exists($license, 'status') && 'error' === $license->status) { |
|
1179 | 1179 | $is_license_key = false; |
1180 | 1180 | } |
1181 | 1181 | |
1182 | 1182 | // Check if current license is part of subscription or not. |
1183 | - $subscriptions = get_option( 'give_subscriptions' ); |
|
1183 | + $subscriptions = get_option('give_subscriptions'); |
|
1184 | 1184 | |
1185 | - if ( $is_license_key && $subscriptions ) { |
|
1186 | - foreach ( $subscriptions as $subscription ) { |
|
1187 | - if ( in_array( $license_key, $subscription['licenses'] ) ) { |
|
1185 | + if ($is_license_key && $subscriptions) { |
|
1186 | + foreach ($subscriptions as $subscription) { |
|
1187 | + if (in_array($license_key, $subscription['licenses'])) { |
|
1188 | 1188 | $is_in_subscription = $subscription['id']; |
1189 | 1189 | break; |
1190 | 1190 | } |
1191 | 1191 | } |
1192 | 1192 | } |
1193 | 1193 | |
1194 | - if ( $is_license_key ) { |
|
1195 | - if ( $is_in_subscription ) { |
|
1196 | - $subscription_expires = strtotime( $subscriptions[ $is_in_subscription ]['expires'] ); |
|
1197 | - $subscription_status = esc_html__( 'renew', 'give' ); |
|
1194 | + if ($is_license_key) { |
|
1195 | + if ($is_in_subscription) { |
|
1196 | + $subscription_expires = strtotime($subscriptions[$is_in_subscription]['expires']); |
|
1197 | + $subscription_status = esc_html__('renew', 'give'); |
|
1198 | 1198 | |
1199 | - if ( ( 'active' !== $subscriptions[ $is_in_subscription ]['status'] ) ) { |
|
1200 | - $subscription_status = esc_html__( 'expire', 'give' ); |
|
1199 | + if (('active' !== $subscriptions[$is_in_subscription]['status'])) { |
|
1200 | + $subscription_status = esc_html__('expire', 'give'); |
|
1201 | 1201 | } |
1202 | 1202 | |
1203 | - if ( $subscription_expires < current_time( 'timestamp', 1 ) ) { |
|
1204 | - $messages[] = sprintf( |
|
1205 | - __( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) expired. Please <a href="%3$s" target="_blank" title="Renew your license key">renew your license key</a>', 'give' ), |
|
1206 | - urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ), |
|
1207 | - $subscriptions[ $is_in_subscription ]['payment_id'], |
|
1208 | - $checkout_page_link . '?edd_license_key=' . $subscriptions[ $is_in_subscription ]['license_key'] . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired' |
|
1203 | + if ($subscription_expires < current_time('timestamp', 1)) { |
|
1204 | + $messages[] = sprintf( |
|
1205 | + __('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) expired. Please <a href="%3$s" target="_blank" title="Renew your license key">renew your license key</a>', 'give'), |
|
1206 | + urldecode($subscriptions[$is_in_subscription]['invoice_url']), |
|
1207 | + $subscriptions[$is_in_subscription]['payment_id'], |
|
1208 | + $checkout_page_link.'?edd_license_key='.$subscriptions[$is_in_subscription]['license_key'].'&utm_campaign=admin&utm_source=licenses&utm_medium=expired' |
|
1209 | 1209 | ); |
1210 | 1210 | $license_status = 'license-expired'; |
1211 | - } elseif ( strtotime( '- 7 days', $subscription_expires ) < current_time( 'timestamp', 1 ) ) { |
|
1211 | + } elseif (strtotime('- 7 days', $subscription_expires) < current_time('timestamp', 1)) { |
|
1212 | 1212 | $messages[] = sprintf( |
1213 | - __( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s in %4$s.', 'give' ), |
|
1214 | - urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ), |
|
1215 | - $subscriptions[ $is_in_subscription ]['payment_id'], |
|
1213 | + __('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s in %4$s.', 'give'), |
|
1214 | + urldecode($subscriptions[$is_in_subscription]['invoice_url']), |
|
1215 | + $subscriptions[$is_in_subscription]['payment_id'], |
|
1216 | 1216 | $subscription_status, |
1217 | - human_time_diff( current_time( 'timestamp', 1 ), strtotime( $subscriptions[ $is_in_subscription ]['expires'] ) ) |
|
1217 | + human_time_diff(current_time('timestamp', 1), strtotime($subscriptions[$is_in_subscription]['expires'])) |
|
1218 | 1218 | ); |
1219 | 1219 | $license_status = 'license-expires-soon'; |
1220 | 1220 | } else { |
1221 | 1221 | $messages[] = sprintf( |
1222 | - __( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s on %4$s.', 'give' ), |
|
1223 | - urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ), |
|
1224 | - $subscriptions[ $is_in_subscription ]['payment_id'], |
|
1222 | + __('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s on %4$s.', 'give'), |
|
1223 | + urldecode($subscriptions[$is_in_subscription]['invoice_url']), |
|
1224 | + $subscriptions[$is_in_subscription]['payment_id'], |
|
1225 | 1225 | $subscription_status, |
1226 | - date_i18n( get_option( 'date_format' ), strtotime( $subscriptions[ $is_in_subscription ]['expires'], current_time( 'timestamp' ) ) ) |
|
1226 | + date_i18n(get_option('date_format'), strtotime($subscriptions[$is_in_subscription]['expires'], current_time('timestamp'))) |
|
1227 | 1227 | ); |
1228 | 1228 | $license_status = 'license-expiration-date'; |
1229 | 1229 | } |
1230 | - } elseif ( empty( $license->success ) && property_exists( $license, 'error' ) ) { |
|
1230 | + } elseif (empty($license->success) && property_exists($license, 'error')) { |
|
1231 | 1231 | |
1232 | 1232 | // activate_license 'invalid' on anything other than valid, so if there was an error capture it |
1233 | - switch ( $license->error ) { |
|
1233 | + switch ($license->error) { |
|
1234 | 1234 | case 'expired' : |
1235 | 1235 | $class = $license->error; |
1236 | 1236 | $messages[] = sprintf( |
1237 | - __( 'Your license key expired on %1$s. Please <a href="%2$s" target="_blank" title="Renew your license key">renew your license key</a>.', 'give' ), |
|
1238 | - date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ), |
|
1239 | - $checkout_page_link . '?edd_license_key=' . $license_key . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired' |
|
1237 | + __('Your license key expired on %1$s. Please <a href="%2$s" target="_blank" title="Renew your license key">renew your license key</a>.', 'give'), |
|
1238 | + date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp'))), |
|
1239 | + $checkout_page_link.'?edd_license_key='.$license_key.'&utm_campaign=admin&utm_source=licenses&utm_medium=expired' |
|
1240 | 1240 | ); |
1241 | - $license_status = 'license-' . $class; |
|
1241 | + $license_status = 'license-'.$class; |
|
1242 | 1242 | break; |
1243 | 1243 | |
1244 | 1244 | case 'missing' : |
1245 | 1245 | $class = $license->error; |
1246 | 1246 | $messages[] = sprintf( |
1247 | - __( 'Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'give' ), |
|
1248 | - $account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=missing' |
|
1247 | + __('Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'give'), |
|
1248 | + $account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=missing' |
|
1249 | 1249 | ); |
1250 | - $license_status = 'license-' . $class; |
|
1250 | + $license_status = 'license-'.$class; |
|
1251 | 1251 | break; |
1252 | 1252 | |
1253 | 1253 | case 'invalid' : |
1254 | 1254 | $class = $license->error; |
1255 | 1255 | $messages[] = sprintf( |
1256 | - __( 'Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ), |
|
1256 | + __('Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'), |
|
1257 | 1257 | $addon_name, |
1258 | - $account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid' |
|
1258 | + $account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid' |
|
1259 | 1259 | ); |
1260 | - $license_status = 'license-' . $class; |
|
1260 | + $license_status = 'license-'.$class; |
|
1261 | 1261 | break; |
1262 | 1262 | |
1263 | 1263 | case 'site_inactive' : |
1264 | 1264 | $class = $license->error; |
1265 | 1265 | $messages[] = sprintf( |
1266 | - __( 'Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ), |
|
1266 | + __('Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'), |
|
1267 | 1267 | $addon_name, |
1268 | - $account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid' |
|
1268 | + $account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid' |
|
1269 | 1269 | ); |
1270 | - $license_status = 'license-' . $class; |
|
1270 | + $license_status = 'license-'.$class; |
|
1271 | 1271 | break; |
1272 | 1272 | |
1273 | 1273 | case 'item_name_mismatch' : |
1274 | 1274 | $class = $license->error; |
1275 | - $messages[] = sprintf( __( 'This license %1$s does not belong to %2$s.', 'give' ), $license_key, $addon_name ); |
|
1276 | - $license_status = 'license-' . $class; |
|
1275 | + $messages[] = sprintf(__('This license %1$s does not belong to %2$s.', 'give'), $license_key, $addon_name); |
|
1276 | + $license_status = 'license-'.$class; |
|
1277 | 1277 | break; |
1278 | 1278 | |
1279 | 1279 | case 'no_activations_left': |
1280 | 1280 | $class = $license->error; |
1281 | - $messages[] = sprintf( __( 'Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give' ), $account_page_link ); |
|
1282 | - $license_status = 'license-' . $class; |
|
1281 | + $messages[] = sprintf(__('Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give'), $account_page_link); |
|
1282 | + $license_status = 'license-'.$class; |
|
1283 | 1283 | break; |
1284 | 1284 | } |
1285 | 1285 | } else { |
1286 | - switch ( $license->license ) { |
|
1286 | + switch ($license->license) { |
|
1287 | 1287 | case 'valid' : |
1288 | 1288 | default: |
1289 | 1289 | $class = 'valid'; |
1290 | - $now = current_time( 'timestamp' ); |
|
1291 | - $expiration = strtotime( $license->expires, current_time( 'timestamp' ) ); |
|
1290 | + $now = current_time('timestamp'); |
|
1291 | + $expiration = strtotime($license->expires, current_time('timestamp')); |
|
1292 | 1292 | |
1293 | - if ( 'lifetime' === $license->expires ) { |
|
1294 | - $messages[] = esc_html__( 'License key never expires.', 'give' ); |
|
1293 | + if ('lifetime' === $license->expires) { |
|
1294 | + $messages[] = esc_html__('License key never expires.', 'give'); |
|
1295 | 1295 | $license_status = 'license-lifetime-notice'; |
1296 | - } elseif ( $expiration > $now && $expiration - $now < ( DAY_IN_SECONDS * 30 ) ) { |
|
1296 | + } elseif ($expiration > $now && $expiration - $now < (DAY_IN_SECONDS * 30)) { |
|
1297 | 1297 | $messages[] = sprintf( |
1298 | - __( 'Your license key expires soon! It expires on %1$s. <a href="%2$s" target="_blank" title="Renew license">Renew your license key</a>.', 'give' ), |
|
1299 | - date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ), |
|
1300 | - $checkout_page_link . '?edd_license_key=' . $license_key . '&utm_campaign=admin&utm_source=licenses&utm_medium=renew' |
|
1298 | + __('Your license key expires soon! It expires on %1$s. <a href="%2$s" target="_blank" title="Renew license">Renew your license key</a>.', 'give'), |
|
1299 | + date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp'))), |
|
1300 | + $checkout_page_link.'?edd_license_key='.$license_key.'&utm_campaign=admin&utm_source=licenses&utm_medium=renew' |
|
1301 | 1301 | ); |
1302 | 1302 | $license_status = 'license-expires-soon'; |
1303 | 1303 | } else { |
1304 | 1304 | $messages[] = sprintf( |
1305 | - __( 'Your license key expires on %s.', 'give' ), |
|
1306 | - date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ) |
|
1305 | + __('Your license key expires on %s.', 'give'), |
|
1306 | + date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp'))) |
|
1307 | 1307 | ); |
1308 | 1308 | $license_status = 'license-expiration-date'; |
1309 | 1309 | } |
@@ -1311,15 +1311,15 @@ discard block |
||
1311 | 1311 | } |
1312 | 1312 | } |
1313 | 1313 | } else { |
1314 | - $messages[] = sprintf( |
|
1315 | - __( 'To receive updates, please enter your valid %s license key.', 'give' ), |
|
1314 | + $messages[] = sprintf( |
|
1315 | + __('To receive updates, please enter your valid %s license key.', 'give'), |
|
1316 | 1316 | $addon_name |
1317 | 1317 | ); |
1318 | 1318 | $license_status = 'inactive'; |
1319 | 1319 | } |
1320 | 1320 | |
1321 | 1321 | // Add class for input field if license is active. |
1322 | - if ( $is_valid_license ) { |
|
1322 | + if ($is_valid_license) { |
|
1323 | 1323 | $field_classes .= ' give-license-active'; |
1324 | 1324 | } |
1325 | 1325 | |
@@ -1327,33 +1327,33 @@ discard block |
||
1327 | 1327 | $input_field_html = "<input type=\"{$type}\" name=\"{$id}\" class=\"{$field_classes}\" value=\"{$license_key}\">"; |
1328 | 1328 | |
1329 | 1329 | // If license is active so show deactivate button. |
1330 | - if ( $is_valid_license ) { |
|
1330 | + if ($is_valid_license) { |
|
1331 | 1331 | // Get input field html. |
1332 | 1332 | $input_field_html = "<input type=\"{$type}\" name=\"{$id}\" class=\"{$field_classes}\" value=\"{$license_key}\" readonly=\"readonly\">"; |
1333 | 1333 | |
1334 | - $custom_html = '<input type="submit" class="button button-small give-license-deactivate" name="' . $id . '_deactivate" value="' . esc_attr__( 'Deactivate License', 'give' ) . '"/>'; |
|
1334 | + $custom_html = '<input type="submit" class="button button-small give-license-deactivate" name="'.$id.'_deactivate" value="'.esc_attr__('Deactivate License', 'give').'"/>'; |
|
1335 | 1335 | |
1336 | 1336 | } |
1337 | 1337 | |
1338 | 1338 | // Field description. |
1339 | - $custom_html .= '<label for="give_settings[' . $id . ']"> ' . $field_description . '</label>'; |
|
1339 | + $custom_html .= '<label for="give_settings['.$id.']"> '.$field_description.'</label>'; |
|
1340 | 1340 | |
1341 | 1341 | // If no messages found then inform user that to get updated in future register yourself. |
1342 | - if ( empty( $messages ) ) { |
|
1343 | - $messages[] = apply_filters( "{$shortname}_default_addon_notice", esc_html__( 'To receive updates, please enter your valid license key.', 'give' ) ); |
|
1342 | + if (empty($messages)) { |
|
1343 | + $messages[] = apply_filters("{$shortname}_default_addon_notice", esc_html__('To receive updates, please enter your valid license key.', 'give')); |
|
1344 | 1344 | } |
1345 | 1345 | |
1346 | - foreach ( $messages as $message ) { |
|
1347 | - $custom_html .= '<div class="give-license-status-notice give-' . $license_status . '">'; |
|
1348 | - $custom_html .= '<p>' . $message . '</p>'; |
|
1346 | + foreach ($messages as $message) { |
|
1347 | + $custom_html .= '<div class="give-license-status-notice give-'.$license_status.'">'; |
|
1348 | + $custom_html .= '<p>'.$message.'</p>'; |
|
1349 | 1349 | $custom_html .= '</div>'; |
1350 | 1350 | } |
1351 | 1351 | |
1352 | 1352 | // Field html. |
1353 | - $custom_html = apply_filters( 'give_license_key_field_html', $input_field_html . $custom_html, $field_type_object ); |
|
1353 | + $custom_html = apply_filters('give_license_key_field_html', $input_field_html.$custom_html, $field_type_object); |
|
1354 | 1354 | |
1355 | 1355 | // Nonce. |
1356 | - wp_nonce_field( $id . '-nonce', $id . '-nonce' ); |
|
1356 | + wp_nonce_field($id.'-nonce', $id.'-nonce'); |
|
1357 | 1357 | |
1358 | 1358 | // Print field html. |
1359 | 1359 | echo "<div class=\"give-license-key\"><label for=\"{$id}\">{$addon_name }</label></div><div class=\"give-license-block\">{$custom_html}</div>"; |
@@ -1368,7 +1368,7 @@ discard block |
||
1368 | 1368 | */ |
1369 | 1369 | function give_api_callback() { |
1370 | 1370 | |
1371 | - if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
1371 | + if ( ! current_user_can('manage_give_settings')) { |
|
1372 | 1372 | return; |
1373 | 1373 | } |
1374 | 1374 | |
@@ -1377,9 +1377,9 @@ discard block |
||
1377 | 1377 | * |
1378 | 1378 | * @since 1.0 |
1379 | 1379 | */ |
1380 | - do_action( 'give_tools_api_keys_before' ); |
|
1380 | + do_action('give_tools_api_keys_before'); |
|
1381 | 1381 | |
1382 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php'; |
|
1382 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php'; |
|
1383 | 1383 | |
1384 | 1384 | $api_keys_table = new Give_API_Keys_Table(); |
1385 | 1385 | $api_keys_table->prepare_items(); |
@@ -1388,9 +1388,9 @@ discard block |
||
1388 | 1388 | <span class="cmb2-metabox-description api-description"> |
1389 | 1389 | <?php echo sprintf( |
1390 | 1390 | /* translators: 1: http://docs.givewp.com/api 2: http://docs.givewp.com/addon-zapier */ |
1391 | - __( 'You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give' ), |
|
1392 | - esc_url( 'http://docs.givewp.com/api' ), |
|
1393 | - esc_url( 'http://docs.givewp.com/addon-zapier' ) |
|
1391 | + __('You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give'), |
|
1392 | + esc_url('http://docs.givewp.com/api'), |
|
1393 | + esc_url('http://docs.givewp.com/addon-zapier') |
|
1394 | 1394 | ); ?> |
1395 | 1395 | </span> |
1396 | 1396 | <?php |
@@ -1400,10 +1400,10 @@ discard block |
||
1400 | 1400 | * |
1401 | 1401 | * @since 1.0 |
1402 | 1402 | */ |
1403 | - do_action( 'give_tools_api_keys_after' ); |
|
1403 | + do_action('give_tools_api_keys_after'); |
|
1404 | 1404 | } |
1405 | 1405 | |
1406 | -add_action( 'give_settings_tab_api_keys', 'give_api_callback' ); |
|
1406 | +add_action('give_settings_tab_api_keys', 'give_api_callback'); |
|
1407 | 1407 | |
1408 | 1408 | /** |
1409 | 1409 | * Hook Callback |
@@ -1416,7 +1416,7 @@ discard block |
||
1416 | 1416 | * |
1417 | 1417 | * @return void |
1418 | 1418 | */ |
1419 | -function give_hook_callback( $args ) { |
|
1419 | +function give_hook_callback($args) { |
|
1420 | 1420 | |
1421 | 1421 | $id = $args['id']; |
1422 | 1422 | |
@@ -1425,7 +1425,7 @@ discard block |
||
1425 | 1425 | * |
1426 | 1426 | * @since 1.0 |
1427 | 1427 | */ |
1428 | - do_action( "give_{$id}" ); |
|
1428 | + do_action("give_{$id}"); |
|
1429 | 1429 | |
1430 | 1430 | } |
1431 | 1431 | |
@@ -1440,19 +1440,19 @@ discard block |
||
1440 | 1440 | * |
1441 | 1441 | * @return bool |
1442 | 1442 | */ |
1443 | -function give_is_setting_enabled( $value, $compare_with = null ) { |
|
1444 | - if ( ! is_null( $compare_with ) ) { |
|
1443 | +function give_is_setting_enabled($value, $compare_with = null) { |
|
1444 | + if ( ! is_null($compare_with)) { |
|
1445 | 1445 | |
1446 | - if ( is_array( $compare_with ) ) { |
|
1446 | + if (is_array($compare_with)) { |
|
1447 | 1447 | // Output. |
1448 | - return in_array( $value, $compare_with ); |
|
1448 | + return in_array($value, $compare_with); |
|
1449 | 1449 | } |
1450 | 1450 | |
1451 | 1451 | // Output. |
1452 | - return ( $value === $compare_with ); |
|
1452 | + return ($value === $compare_with); |
|
1453 | 1453 | } |
1454 | 1454 | |
1455 | 1455 | // Backward compatibility: From version 1.8 most of setting is modified to enabled/disabled |
1456 | 1456 | // Output. |
1457 | - return ( in_array( $value, array( 'enabled', 'on', 'yes' ) ) ? true : false ); |
|
1457 | + return (in_array($value, array('enabled', 'on', 'yes')) ? true : false); |
|
1458 | 1458 | } |
@@ -10,13 +10,13 @@ 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 | |
17 | 17 | // Load WP_List_Table if not loaded. |
18 | -if ( ! class_exists( 'WP_List_Table' ) ) { |
|
19 | - require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; |
|
18 | +if ( ! class_exists('WP_List_Table')) { |
|
19 | + require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php'; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -118,15 +118,15 @@ discard block |
||
118 | 118 | public function __construct() { |
119 | 119 | |
120 | 120 | // Set parent defaults. |
121 | - parent::__construct( array( |
|
122 | - 'singular' => give_get_forms_label_singular(), // Singular name of the listed records. |
|
123 | - 'plural' => give_get_forms_label_plural(), // Plural name of the listed records. |
|
124 | - 'ajax' => false, // Does this table support ajax? |
|
125 | - ) ); |
|
121 | + parent::__construct(array( |
|
122 | + 'singular' => give_get_forms_label_singular(), // Singular name of the listed records. |
|
123 | + 'plural' => give_get_forms_label_plural(), // Plural name of the listed records. |
|
124 | + 'ajax' => false, // Does this table support ajax? |
|
125 | + )); |
|
126 | 126 | |
127 | 127 | $this->get_payment_counts(); |
128 | 128 | $this->process_bulk_action(); |
129 | - $this->base_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); |
|
129 | + $this->base_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history'); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -135,29 +135,29 @@ discard block |
||
135 | 135 | * @return void |
136 | 136 | */ |
137 | 137 | public function advanced_filters() { |
138 | - $start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null; |
|
139 | - $end_date = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : null; |
|
140 | - $status = isset( $_GET['status'] ) ? $_GET['status'] : ''; |
|
138 | + $start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null; |
|
139 | + $end_date = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : null; |
|
140 | + $status = isset($_GET['status']) ? $_GET['status'] : ''; |
|
141 | 141 | ?> |
142 | 142 | <div id="give-payment-filters"> |
143 | 143 | <span id="give-payment-date-filters"> |
144 | 144 | <label for="start-date" |
145 | - class="give-start-date-label"><?php esc_html_e( 'Start Date:', 'give' ); ?></label> |
|
145 | + class="give-start-date-label"><?php esc_html_e('Start Date:', 'give'); ?></label> |
|
146 | 146 | <input type="text" id="start-date" name="start-date" class="give_datepicker" |
147 | 147 | value="<?php echo $start_date; ?>" placeholder="mm/dd/yyyy"/> |
148 | - <label for="end-date" class="give-end-date-label"><?php esc_html_e( 'End Date:', 'give' ); ?></label> |
|
148 | + <label for="end-date" class="give-end-date-label"><?php esc_html_e('End Date:', 'give'); ?></label> |
|
149 | 149 | <input type="text" id="end-date" name="end-date" class="give_datepicker" |
150 | 150 | value="<?php echo $end_date; ?>" placeholder="mm/dd/yyyy"/> |
151 | - <input type="submit" class="button-secondary" value="<?php esc_attr_e( 'Apply', 'give' ); ?>"/> |
|
151 | + <input type="submit" class="button-secondary" value="<?php esc_attr_e('Apply', 'give'); ?>"/> |
|
152 | 152 | </span> |
153 | - <?php if ( ! empty( $status ) ) : ?> |
|
154 | - <input type="hidden" name="status" value="<?php echo esc_attr( $status ); ?>"/> |
|
153 | + <?php if ( ! empty($status)) : ?> |
|
154 | + <input type="hidden" name="status" value="<?php echo esc_attr($status); ?>"/> |
|
155 | 155 | <?php endif; ?> |
156 | - <?php if ( ! empty( $start_date ) || ! empty( $end_date ) ) : ?> |
|
157 | - <a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); ?>" |
|
158 | - class="button-secondary"><?php esc_html_e( 'Clear Filter', 'give' ); ?></a> |
|
156 | + <?php if ( ! empty($start_date) || ! empty($end_date)) : ?> |
|
157 | + <a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history'); ?>" |
|
158 | + class="button-secondary"><?php esc_html_e('Clear Filter', 'give'); ?></a> |
|
159 | 159 | <?php endif; ?> |
160 | - <?php $this->search_box( esc_html__( 'Search', 'give' ), 'give-payments' ); ?> |
|
160 | + <?php $this->search_box(esc_html__('Search', 'give'), 'give-payments'); ?> |
|
161 | 161 | </div> |
162 | 162 | |
163 | 163 | <?php |
@@ -174,18 +174,18 @@ discard block |
||
174 | 174 | * |
175 | 175 | * @return void |
176 | 176 | */ |
177 | - public function search_box( $text, $input_id ) { |
|
178 | - if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) { |
|
177 | + public function search_box($text, $input_id) { |
|
178 | + if (empty($_REQUEST['s']) && ! $this->has_items()) { |
|
179 | 179 | return; |
180 | 180 | } |
181 | 181 | |
182 | - $input_id = $input_id . '-search-input'; |
|
182 | + $input_id = $input_id.'-search-input'; |
|
183 | 183 | |
184 | - if ( ! empty( $_REQUEST['orderby'] ) ) { |
|
185 | - echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />'; |
|
184 | + if ( ! empty($_REQUEST['orderby'])) { |
|
185 | + echo '<input type="hidden" name="orderby" value="'.esc_attr($_REQUEST['orderby']).'" />'; |
|
186 | 186 | } |
187 | - if ( ! empty( $_REQUEST['order'] ) ) { |
|
188 | - echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />'; |
|
187 | + if ( ! empty($_REQUEST['order'])) { |
|
188 | + echo '<input type="hidden" name="order" value="'.esc_attr($_REQUEST['order']).'" />'; |
|
189 | 189 | } |
190 | 190 | ?> |
191 | 191 | <p class="search-box" role="search"> |
@@ -197,11 +197,11 @@ discard block |
||
197 | 197 | * |
198 | 198 | * @since 1.7 |
199 | 199 | */ |
200 | - do_action( 'give_payment_history_search' ); |
|
200 | + do_action('give_payment_history_search'); |
|
201 | 201 | ?> |
202 | 202 | <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label> |
203 | 203 | <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>"/> |
204 | - <?php submit_button( $text, 'button', false, false, array( 'ID' => 'search-submit' ) ); ?><br/> |
|
204 | + <?php submit_button($text, 'button', false, false, array('ID' => 'search-submit')); ?><br/> |
|
205 | 205 | </p> |
206 | 206 | <?php |
207 | 207 | } |
@@ -215,52 +215,52 @@ discard block |
||
215 | 215 | */ |
216 | 216 | public function get_views() { |
217 | 217 | |
218 | - $current = isset( $_GET['status'] ) ? $_GET['status'] : ''; |
|
219 | - $total_count = ' <span class="count">(' . $this->total_count . ')</span>'; |
|
220 | - $complete_count = ' <span class="count">(' . $this->complete_count . ')</span>'; |
|
221 | - $cancelled_count = ' <span class="count">(' . $this->cancelled_count . ')</span>'; |
|
222 | - $pending_count = ' <span class="count">(' . $this->pending_count . ')</span>'; |
|
223 | - $refunded_count = ' <span class="count">(' . $this->refunded_count . ')</span>'; |
|
224 | - $failed_count = ' <span class="count">(' . $this->failed_count . ')</span>'; |
|
225 | - $abandoned_count = ' <span class="count">(' . $this->abandoned_count . ')</span>'; |
|
226 | - $revoked_count = ' <span class="count">(' . $this->revoked_count . ')</span>'; |
|
218 | + $current = isset($_GET['status']) ? $_GET['status'] : ''; |
|
219 | + $total_count = ' <span class="count">('.$this->total_count.')</span>'; |
|
220 | + $complete_count = ' <span class="count">('.$this->complete_count.')</span>'; |
|
221 | + $cancelled_count = ' <span class="count">('.$this->cancelled_count.')</span>'; |
|
222 | + $pending_count = ' <span class="count">('.$this->pending_count.')</span>'; |
|
223 | + $refunded_count = ' <span class="count">('.$this->refunded_count.')</span>'; |
|
224 | + $failed_count = ' <span class="count">('.$this->failed_count.')</span>'; |
|
225 | + $abandoned_count = ' <span class="count">('.$this->abandoned_count.')</span>'; |
|
226 | + $revoked_count = ' <span class="count">('.$this->revoked_count.')</span>'; |
|
227 | 227 | |
228 | 228 | $views = array( |
229 | - 'all' => sprintf( '<a href="%s"%s>%s</a>', remove_query_arg( array( |
|
229 | + 'all' => sprintf('<a href="%s"%s>%s</a>', remove_query_arg(array( |
|
230 | 230 | 'status', |
231 | 231 | 'paged', |
232 | - ) ), $current === 'all' || $current == '' ? ' class="current"' : '', esc_html__( 'All', 'give' ) . $total_count ), |
|
233 | - 'publish' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array( |
|
232 | + )), $current === 'all' || $current == '' ? ' class="current"' : '', esc_html__('All', 'give').$total_count), |
|
233 | + 'publish' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( |
|
234 | 234 | 'status' => 'publish', |
235 | 235 | 'paged' => false, |
236 | - ) ) ), $current === 'publish' ? ' class="current"' : '', esc_html__( 'Completed', 'give' ) . $complete_count ), |
|
237 | - 'pending' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array( |
|
236 | + ))), $current === 'publish' ? ' class="current"' : '', esc_html__('Completed', 'give').$complete_count), |
|
237 | + 'pending' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( |
|
238 | 238 | 'status' => 'pending', |
239 | 239 | 'paged' => false, |
240 | - ) ) ), $current === 'pending' ? ' class="current"' : '', esc_html__( 'Pending', 'give' ) . $pending_count ), |
|
241 | - 'refunded' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array( |
|
240 | + ))), $current === 'pending' ? ' class="current"' : '', esc_html__('Pending', 'give').$pending_count), |
|
241 | + 'refunded' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( |
|
242 | 242 | 'status' => 'refunded', |
243 | 243 | 'paged' => false, |
244 | - ) ) ), $current === 'refunded' ? ' class="current"' : '', esc_html__( 'Refunded', 'give' ) . $refunded_count ), |
|
245 | - 'revoked' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array( |
|
244 | + ))), $current === 'refunded' ? ' class="current"' : '', esc_html__('Refunded', 'give').$refunded_count), |
|
245 | + 'revoked' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( |
|
246 | 246 | 'status' => 'revoked', |
247 | 247 | 'paged' => false, |
248 | - ) ) ), $current === 'revoked' ? ' class="current"' : '', esc_html__( 'Revoked', 'give' ) . $revoked_count ), |
|
249 | - 'failed' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array( |
|
248 | + ))), $current === 'revoked' ? ' class="current"' : '', esc_html__('Revoked', 'give').$revoked_count), |
|
249 | + 'failed' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( |
|
250 | 250 | 'status' => 'failed', |
251 | 251 | 'paged' => false, |
252 | - ) ) ), $current === 'failed' ? ' class="current"' : '', esc_html__( 'Failed', 'give' ) . $failed_count ), |
|
253 | - 'cancelled' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array( |
|
252 | + ))), $current === 'failed' ? ' class="current"' : '', esc_html__('Failed', 'give').$failed_count), |
|
253 | + 'cancelled' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( |
|
254 | 254 | 'status' => 'cancelled', |
255 | 255 | 'paged' => false, |
256 | - ) ) ), $current === 'cancelled' ? ' class="current"' : '', esc_html__( 'Cancelled', 'give' ) . $cancelled_count ), |
|
257 | - 'abandoned' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array( |
|
256 | + ))), $current === 'cancelled' ? ' class="current"' : '', esc_html__('Cancelled', 'give').$cancelled_count), |
|
257 | + 'abandoned' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( |
|
258 | 258 | 'status' => 'abandoned', |
259 | 259 | 'paged' => false, |
260 | - ) ) ), $current === 'abandoned' ? ' class="current"' : '', esc_html__( 'Abandoned', 'give' ) . $abandoned_count ), |
|
260 | + ))), $current === 'abandoned' ? ' class="current"' : '', esc_html__('Abandoned', 'give').$abandoned_count), |
|
261 | 261 | ); |
262 | 262 | |
263 | - return apply_filters( 'give_payments_table_views', $views ); |
|
263 | + return apply_filters('give_payments_table_views', $views); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | /** |
@@ -273,15 +273,15 @@ discard block |
||
273 | 273 | public function get_columns() { |
274 | 274 | $columns = array( |
275 | 275 | 'cb' => '<input type="checkbox" />', // Render a checkbox instead of text. |
276 | - 'donation' => esc_html__( 'Donation', 'give' ), |
|
277 | - 'donation_form' => esc_html__( 'Donation Form', 'give' ), |
|
278 | - 'status' => esc_html__( 'Status', 'give' ), |
|
279 | - 'date' => esc_html__( 'Date', 'give' ), |
|
280 | - 'amount' => esc_html__( 'Amount', 'give' ), |
|
281 | - 'details' => esc_html__( 'Details', 'give' ), |
|
276 | + 'donation' => esc_html__('Donation', 'give'), |
|
277 | + 'donation_form' => esc_html__('Donation Form', 'give'), |
|
278 | + 'status' => esc_html__('Status', 'give'), |
|
279 | + 'date' => esc_html__('Date', 'give'), |
|
280 | + 'amount' => esc_html__('Amount', 'give'), |
|
281 | + 'details' => esc_html__('Details', 'give'), |
|
282 | 282 | ); |
283 | 283 | |
284 | - return apply_filters( 'give_payments_table_columns', $columns ); |
|
284 | + return apply_filters('give_payments_table_columns', $columns); |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | /** |
@@ -293,14 +293,14 @@ discard block |
||
293 | 293 | */ |
294 | 294 | public function get_sortable_columns() { |
295 | 295 | $columns = array( |
296 | - 'donation' => array( 'ID', true ), |
|
297 | - 'donation_form' => array( 'donation_form', false ), |
|
298 | - 'status' => array( 'status', false ), |
|
299 | - 'amount' => array( 'amount', false ), |
|
300 | - 'date' => array( 'date', false ), |
|
296 | + 'donation' => array('ID', true), |
|
297 | + 'donation_form' => array('donation_form', false), |
|
298 | + 'status' => array('status', false), |
|
299 | + 'amount' => array('amount', false), |
|
300 | + 'date' => array('date', false), |
|
301 | 301 | ); |
302 | 302 | |
303 | - return apply_filters( 'give_payments_table_sortable_columns', $columns ); |
|
303 | + return apply_filters('give_payments_table_sortable_columns', $columns); |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | /** |
@@ -326,65 +326,65 @@ discard block |
||
326 | 326 | * |
327 | 327 | * @return string Column Name |
328 | 328 | */ |
329 | - public function column_default( $payment, $column_name ) { |
|
329 | + public function column_default($payment, $column_name) { |
|
330 | 330 | |
331 | - $single_donation_url = esc_url( add_query_arg( 'id', $payment->ID, admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details' ) ) ); |
|
332 | - $row_actions = $this->get_row_actions( $payment ); |
|
331 | + $single_donation_url = esc_url(add_query_arg('id', $payment->ID, admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details'))); |
|
332 | + $row_actions = $this->get_row_actions($payment); |
|
333 | 333 | |
334 | - switch ( $column_name ) { |
|
334 | + switch ($column_name) { |
|
335 | 335 | case 'donation' : |
336 | 336 | $value = sprintf( |
337 | 337 | '<a href="%1$s" data-tooltip="%2$s">#%3$s</a> %4$s %5$s<br>', |
338 | 338 | $single_donation_url, |
339 | - sprintf( esc_attr__( 'View Donation %s', 'give' ), $payment->ID ), |
|
339 | + sprintf(esc_attr__('View Donation %s', 'give'), $payment->ID), |
|
340 | 340 | $payment->ID, |
341 | - esc_html__( 'by', 'give' ), |
|
342 | - $this->get_donor( $payment ) |
|
341 | + esc_html__('by', 'give'), |
|
342 | + $this->get_donor($payment) |
|
343 | 343 | ); |
344 | - $value .= $this->get_donor_email( $payment ); |
|
345 | - $value .= $this->row_actions( $row_actions ); |
|
344 | + $value .= $this->get_donor_email($payment); |
|
345 | + $value .= $this->row_actions($row_actions); |
|
346 | 346 | break; |
347 | 347 | |
348 | 348 | case 'amount' : |
349 | - $amount = ! empty( $payment->total ) ? $payment->total : 0; |
|
350 | - $value = give_currency_filter( give_format_amount( $amount ), give_get_payment_currency_code( $payment->ID ) ); |
|
349 | + $amount = ! empty($payment->total) ? $payment->total : 0; |
|
350 | + $value = give_currency_filter(give_format_amount($amount), give_get_payment_currency_code($payment->ID)); |
|
351 | 351 | break; |
352 | 352 | |
353 | 353 | case 'donation_form' : |
354 | - $form_title = empty( $payment->form_title ) ? sprintf( __( 'Untitled (#%s)', 'give' ), $payment->form_id ) : $payment->form_title; |
|
355 | - $value = '<a href="' . admin_url( 'post.php?post=' . $payment->form_id . '&action=edit' ) . '">' . $form_title . '</a>'; |
|
356 | - $level = give_get_payment_form_title( $payment->meta, true ); |
|
354 | + $form_title = empty($payment->form_title) ? sprintf(__('Untitled (#%s)', 'give'), $payment->form_id) : $payment->form_title; |
|
355 | + $value = '<a href="'.admin_url('post.php?post='.$payment->form_id.'&action=edit').'">'.$form_title.'</a>'; |
|
356 | + $level = give_get_payment_form_title($payment->meta, true); |
|
357 | 357 | |
358 | - if ( ! empty( $level ) ) { |
|
358 | + if ( ! empty($level)) { |
|
359 | 359 | $value .= $level; |
360 | 360 | } |
361 | 361 | |
362 | 362 | break; |
363 | 363 | |
364 | 364 | case 'date' : |
365 | - $date = strtotime( $payment->date ); |
|
366 | - $value = date_i18n( give_date_format(), $date ); |
|
365 | + $date = strtotime($payment->date); |
|
366 | + $value = date_i18n(give_date_format(), $date); |
|
367 | 367 | break; |
368 | 368 | |
369 | 369 | case 'status' : |
370 | - $value = $this->get_payment_status( $payment ); |
|
370 | + $value = $this->get_payment_status($payment); |
|
371 | 371 | break; |
372 | 372 | |
373 | 373 | case 'details' : |
374 | 374 | $value = sprintf( |
375 | 375 | '<div class="give-payment-details-link-wrap"><a href="%1$s" class="give-payment-details-link button button-small" data-tooltip="%2$s" aria-label="%2$s"><span class="dashicons dashicons-visibility"></span></a></div>', |
376 | 376 | $single_donation_url, |
377 | - sprintf( esc_attr__( 'View Donation %s', 'give' ), $payment->ID ) |
|
377 | + sprintf(esc_attr__('View Donation %s', 'give'), $payment->ID) |
|
378 | 378 | ); |
379 | 379 | break; |
380 | 380 | |
381 | 381 | default: |
382 | - $value = isset( $payment->$column_name ) ? $payment->$column_name : ''; |
|
382 | + $value = isset($payment->$column_name) ? $payment->$column_name : ''; |
|
383 | 383 | break; |
384 | 384 | |
385 | 385 | } |
386 | 386 | |
387 | - return apply_filters( 'give_payments_table_column', $value, $payment->ID, $column_name ); |
|
387 | + return apply_filters('give_payments_table_column', $value, $payment->ID, $column_name); |
|
388 | 388 | } |
389 | 389 | |
390 | 390 | /** |
@@ -397,17 +397,17 @@ discard block |
||
397 | 397 | * |
398 | 398 | * @return string Data shown in the Email column |
399 | 399 | */ |
400 | - public function get_donor_email( $payment ) { |
|
400 | + public function get_donor_email($payment) { |
|
401 | 401 | |
402 | - $email = give_get_payment_user_email( $payment->ID ); |
|
402 | + $email = give_get_payment_user_email($payment->ID); |
|
403 | 403 | |
404 | - if ( empty( $email ) ) { |
|
405 | - $email = esc_html__( '(unknown)', 'give' ); |
|
404 | + if (empty($email)) { |
|
405 | + $email = esc_html__('(unknown)', 'give'); |
|
406 | 406 | } |
407 | 407 | |
408 | - $value = '<a href="mailto:' . $email . '" data-tooltip="' . esc_attr__( 'Email donor', 'give' ) . '">' . $email . '</a>'; |
|
408 | + $value = '<a href="mailto:'.$email.'" data-tooltip="'.esc_attr__('Email donor', 'give').'">'.$email.'</a>'; |
|
409 | 409 | |
410 | - return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'email' ); |
|
410 | + return apply_filters('give_payments_table_column', $value, $payment->ID, 'email'); |
|
411 | 411 | } |
412 | 412 | |
413 | 413 | /** |
@@ -419,18 +419,18 @@ discard block |
||
419 | 419 | * |
420 | 420 | * @return array $actions |
421 | 421 | */ |
422 | - function get_row_actions( $payment ) { |
|
422 | + function get_row_actions($payment) { |
|
423 | 423 | |
424 | 424 | $actions = array(); |
425 | - $email = give_get_payment_user_email( $payment->ID ); |
|
425 | + $email = give_get_payment_user_email($payment->ID); |
|
426 | 426 | |
427 | 427 | // Add search term string back to base URL. |
428 | - $search_terms = ( isset( $_GET['s'] ) ? trim( $_GET['s'] ) : '' ); |
|
429 | - if ( ! empty( $search_terms ) ) { |
|
430 | - $this->base_url = add_query_arg( 's', $search_terms, $this->base_url ); |
|
428 | + $search_terms = (isset($_GET['s']) ? trim($_GET['s']) : ''); |
|
429 | + if ( ! empty($search_terms)) { |
|
430 | + $this->base_url = add_query_arg('s', $search_terms, $this->base_url); |
|
431 | 431 | } |
432 | 432 | |
433 | - if ( give_is_payment_complete( $payment->ID ) && ! empty( $email ) ) { |
|
433 | + if (give_is_payment_complete($payment->ID) && ! empty($email)) { |
|
434 | 434 | |
435 | 435 | $actions['email_links'] = sprintf( |
436 | 436 | '<a href="%1$s" aria-label="%2$s">%3$s</a>', |
@@ -444,8 +444,8 @@ discard block |
||
444 | 444 | ), |
445 | 445 | 'give_payment_nonce' |
446 | 446 | ), |
447 | - sprintf( esc_attr__( 'Resend Donation %s Receipt', 'give' ), $payment->ID ), |
|
448 | - esc_html__( 'Resend Receipt', 'give' ) |
|
447 | + sprintf(esc_attr__('Resend Donation %s Receipt', 'give'), $payment->ID), |
|
448 | + esc_html__('Resend Receipt', 'give') |
|
449 | 449 | ); |
450 | 450 | |
451 | 451 | } |
@@ -462,11 +462,11 @@ discard block |
||
462 | 462 | ), |
463 | 463 | 'give_donation_nonce' |
464 | 464 | ), |
465 | - sprintf( esc_attr__( 'Delete Donation %s', 'give' ), $payment->ID ), |
|
466 | - esc_html__( 'Delete', 'give' ) |
|
465 | + sprintf(esc_attr__('Delete Donation %s', 'give'), $payment->ID), |
|
466 | + esc_html__('Delete', 'give') |
|
467 | 467 | ); |
468 | 468 | |
469 | - return apply_filters( 'give_payment_row_actions', $actions, $payment ); |
|
469 | + return apply_filters('give_payment_row_actions', $actions, $payment); |
|
470 | 470 | } |
471 | 471 | |
472 | 472 | |
@@ -480,10 +480,10 @@ discard block |
||
480 | 480 | * |
481 | 481 | * @return string Data shown in the Email column |
482 | 482 | */ |
483 | - function get_payment_status( $payment ) { |
|
484 | - $value = '<div class="give-donation-status status-' . sanitize_title( give_get_payment_status( $payment, true ) ) . '"><span class="give-donation-status-icon"></span> ' . give_get_payment_status( $payment, true ) . '</div>'; |
|
485 | - if ( $payment->mode == 'test' ) { |
|
486 | - $value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="' . esc_attr__( 'This donation was made in test mode.', 'give' ) . '">' . esc_html__( 'Test', 'give' ) . '</span>'; |
|
483 | + function get_payment_status($payment) { |
|
484 | + $value = '<div class="give-donation-status status-'.sanitize_title(give_get_payment_status($payment, true)).'"><span class="give-donation-status-icon"></span> '.give_get_payment_status($payment, true).'</div>'; |
|
485 | + if ($payment->mode == 'test') { |
|
486 | + $value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="'.esc_attr__('This donation was made in test mode.', 'give').'">'.esc_html__('Test', 'give').'</span>'; |
|
487 | 487 | } |
488 | 488 | |
489 | 489 | return $value; |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | * |
500 | 500 | * @return string Displays a checkbox. |
501 | 501 | */ |
502 | - public function column_cb( $payment ) { |
|
502 | + public function column_cb($payment) { |
|
503 | 503 | return sprintf( |
504 | 504 | '<input type="checkbox" name="%1$s[]" value="%2$s" />', |
505 | 505 | 'payment', |
@@ -517,8 +517,8 @@ discard block |
||
517 | 517 | * |
518 | 518 | * @return string Displays a checkbox. |
519 | 519 | */ |
520 | - public function get_payment_id( $payment ) { |
|
521 | - return '<span class="give-payment-id">' . give_get_payment_number( $payment->ID ) . '</span>'; |
|
520 | + public function get_payment_id($payment) { |
|
521 | + return '<span class="give-payment-id">'.give_get_payment_number($payment->ID).'</span>'; |
|
522 | 522 | } |
523 | 523 | |
524 | 524 | /** |
@@ -531,19 +531,19 @@ discard block |
||
531 | 531 | * |
532 | 532 | * @return string Data shown in the User column |
533 | 533 | */ |
534 | - public function get_donor( $payment ) { |
|
534 | + public function get_donor($payment) { |
|
535 | 535 | |
536 | - $customer_id = give_get_payment_customer_id( $payment->ID ); |
|
536 | + $customer_id = give_get_payment_customer_id($payment->ID); |
|
537 | 537 | |
538 | - if ( ! empty( $customer_id ) ) { |
|
539 | - $customer = new Give_Customer( $customer_id ); |
|
540 | - $value = '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id=$customer_id" ) ) . '">' . $customer->name . '</a>'; |
|
538 | + if ( ! empty($customer_id)) { |
|
539 | + $customer = new Give_Customer($customer_id); |
|
540 | + $value = '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-donors&view=overview&id=$customer_id")).'">'.$customer->name.'</a>'; |
|
541 | 541 | } else { |
542 | - $email = give_get_payment_user_email( $payment->ID ); |
|
543 | - $value = '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-payment-history&s=$email" ) ) . '">' . esc_html__( '(donor missing)', 'give' ) . '</a>'; |
|
542 | + $email = give_get_payment_user_email($payment->ID); |
|
543 | + $value = '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-payment-history&s=$email")).'">'.esc_html__('(donor missing)', 'give').'</a>'; |
|
544 | 544 | } |
545 | 545 | |
546 | - return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'donor' ); |
|
546 | + return apply_filters('give_payments_table_column', $value, $payment->ID, 'donor'); |
|
547 | 547 | } |
548 | 548 | |
549 | 549 | /** |
@@ -555,18 +555,18 @@ discard block |
||
555 | 555 | */ |
556 | 556 | public function get_bulk_actions() { |
557 | 557 | $actions = array( |
558 | - 'delete' => esc_html__( 'Delete', 'give' ), |
|
559 | - 'set-status-publish' => esc_html__( 'Set To Completed', 'give' ), |
|
560 | - 'set-status-pending' => esc_html__( 'Set To Pending', 'give' ), |
|
561 | - 'set-status-refunded' => esc_html__( 'Set To Refunded', 'give' ), |
|
562 | - 'set-status-revoked' => esc_html__( 'Set To Revoked', 'give' ), |
|
563 | - 'set-status-failed' => esc_html__( 'Set To Failed', 'give' ), |
|
564 | - 'set-status-cancelled' => esc_html__( 'Set To Cancelled', 'give' ), |
|
565 | - 'set-status-abandoned' => esc_html__( 'Set To Abandoned', 'give' ), |
|
566 | - 'resend-receipt' => esc_html__( 'Resend Email Receipts', 'give' ), |
|
558 | + 'delete' => esc_html__('Delete', 'give'), |
|
559 | + 'set-status-publish' => esc_html__('Set To Completed', 'give'), |
|
560 | + 'set-status-pending' => esc_html__('Set To Pending', 'give'), |
|
561 | + 'set-status-refunded' => esc_html__('Set To Refunded', 'give'), |
|
562 | + 'set-status-revoked' => esc_html__('Set To Revoked', 'give'), |
|
563 | + 'set-status-failed' => esc_html__('Set To Failed', 'give'), |
|
564 | + 'set-status-cancelled' => esc_html__('Set To Cancelled', 'give'), |
|
565 | + 'set-status-abandoned' => esc_html__('Set To Abandoned', 'give'), |
|
566 | + 'resend-receipt' => esc_html__('Resend Email Receipts', 'give'), |
|
567 | 567 | ); |
568 | 568 | |
569 | - return apply_filters( 'give_payments_table_bulk_actions', $actions ); |
|
569 | + return apply_filters('give_payments_table_bulk_actions', $actions); |
|
570 | 570 | } |
571 | 571 | |
572 | 572 | /** |
@@ -577,59 +577,59 @@ discard block |
||
577 | 577 | * @return void |
578 | 578 | */ |
579 | 579 | public function process_bulk_action() { |
580 | - $ids = isset( $_GET['payment'] ) ? $_GET['payment'] : false; |
|
580 | + $ids = isset($_GET['payment']) ? $_GET['payment'] : false; |
|
581 | 581 | $action = $this->current_action(); |
582 | 582 | |
583 | - if ( ! is_array( $ids ) ) { |
|
584 | - $ids = array( $ids ); |
|
583 | + if ( ! is_array($ids)) { |
|
584 | + $ids = array($ids); |
|
585 | 585 | } |
586 | 586 | |
587 | - if ( empty( $action ) ) { |
|
587 | + if (empty($action)) { |
|
588 | 588 | return; |
589 | 589 | } |
590 | 590 | |
591 | - foreach ( $ids as $id ) { |
|
591 | + foreach ($ids as $id) { |
|
592 | 592 | |
593 | 593 | // Detect when a bulk action is being triggered. |
594 | - switch ( $this->current_action() ) { |
|
594 | + switch ($this->current_action()) { |
|
595 | 595 | |
596 | 596 | case'delete': |
597 | - give_delete_purchase( $id ); |
|
597 | + give_delete_purchase($id); |
|
598 | 598 | break; |
599 | 599 | |
600 | 600 | case 'set-status-publish': |
601 | - give_update_payment_status( $id, 'publish' ); |
|
601 | + give_update_payment_status($id, 'publish'); |
|
602 | 602 | break; |
603 | 603 | |
604 | 604 | case 'set-status-pending': |
605 | - give_update_payment_status( $id, 'pending' ); |
|
605 | + give_update_payment_status($id, 'pending'); |
|
606 | 606 | break; |
607 | 607 | |
608 | 608 | case 'set-status-refunded': |
609 | - give_update_payment_status( $id, 'refunded' ); |
|
609 | + give_update_payment_status($id, 'refunded'); |
|
610 | 610 | break; |
611 | 611 | case 'set-status-revoked': |
612 | - give_update_payment_status( $id, 'revoked' ); |
|
612 | + give_update_payment_status($id, 'revoked'); |
|
613 | 613 | break; |
614 | 614 | |
615 | 615 | case 'set-status-failed': |
616 | - give_update_payment_status( $id, 'failed' ); |
|
616 | + give_update_payment_status($id, 'failed'); |
|
617 | 617 | break; |
618 | 618 | |
619 | 619 | case 'set-status-cancelled': |
620 | - give_update_payment_status( $id, 'cancelled' ); |
|
620 | + give_update_payment_status($id, 'cancelled'); |
|
621 | 621 | break; |
622 | 622 | |
623 | 623 | case 'set-status-abandoned': |
624 | - give_update_payment_status( $id, 'abandoned' ); |
|
624 | + give_update_payment_status($id, 'abandoned'); |
|
625 | 625 | break; |
626 | 626 | |
627 | 627 | case 'set-status-preapproval': |
628 | - give_update_payment_status( $id, 'preapproval' ); |
|
628 | + give_update_payment_status($id, 'preapproval'); |
|
629 | 629 | break; |
630 | 630 | |
631 | 631 | case 'resend-receipt': |
632 | - give_email_donation_receipt( $id, false ); |
|
632 | + give_email_donation_receipt($id, false); |
|
633 | 633 | break; |
634 | 634 | } |
635 | 635 | |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | * @param int $id The ID of the payment. |
642 | 642 | * @param string $current_action The action that is being triggered. |
643 | 643 | */ |
644 | - do_action( 'give_payments_table_do_bulk_action', $id, $this->current_action() ); |
|
644 | + do_action('give_payments_table_do_bulk_action', $id, $this->current_action()); |
|
645 | 645 | } |
646 | 646 | |
647 | 647 | } |
@@ -657,27 +657,27 @@ discard block |
||
657 | 657 | |
658 | 658 | $args = array(); |
659 | 659 | |
660 | - if ( isset( $_GET['user'] ) ) { |
|
661 | - $args['user'] = urldecode( $_GET['user'] ); |
|
662 | - } elseif ( isset( $_GET['s'] ) ) { |
|
663 | - $is_user = strpos( $_GET['s'], strtolower( 'user:' ) ) !== false; |
|
664 | - if ( $is_user ) { |
|
665 | - $args['user'] = absint( trim( str_replace( 'user:', '', strtolower( $_GET['s'] ) ) ) ); |
|
666 | - unset( $args['s'] ); |
|
660 | + if (isset($_GET['user'])) { |
|
661 | + $args['user'] = urldecode($_GET['user']); |
|
662 | + } elseif (isset($_GET['s'])) { |
|
663 | + $is_user = strpos($_GET['s'], strtolower('user:')) !== false; |
|
664 | + if ($is_user) { |
|
665 | + $args['user'] = absint(trim(str_replace('user:', '', strtolower($_GET['s'])))); |
|
666 | + unset($args['s']); |
|
667 | 667 | } else { |
668 | - $args['s'] = sanitize_text_field( $_GET['s'] ); |
|
668 | + $args['s'] = sanitize_text_field($_GET['s']); |
|
669 | 669 | } |
670 | 670 | } |
671 | 671 | |
672 | - if ( ! empty( $_GET['start-date'] ) ) { |
|
673 | - $args['start-date'] = urldecode( $_GET['start-date'] ); |
|
672 | + if ( ! empty($_GET['start-date'])) { |
|
673 | + $args['start-date'] = urldecode($_GET['start-date']); |
|
674 | 674 | } |
675 | 675 | |
676 | - if ( ! empty( $_GET['end-date'] ) ) { |
|
677 | - $args['end-date'] = urldecode( $_GET['end-date'] ); |
|
676 | + if ( ! empty($_GET['end-date'])) { |
|
677 | + $args['end-date'] = urldecode($_GET['end-date']); |
|
678 | 678 | } |
679 | 679 | |
680 | - $payment_count = give_count_payments( $args ); |
|
680 | + $payment_count = give_count_payments($args); |
|
681 | 681 | $this->complete_count = $payment_count->publish; |
682 | 682 | $this->pending_count = $payment_count->pending; |
683 | 683 | $this->refunded_count = $payment_count->refunded; |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | $this->cancelled_count = $payment_count->cancelled; |
687 | 687 | $this->abandoned_count = $payment_count->abandoned; |
688 | 688 | |
689 | - foreach ( $payment_count as $count ) { |
|
689 | + foreach ($payment_count as $count) { |
|
690 | 690 | $this->total_count += $count; |
691 | 691 | } |
692 | 692 | } |
@@ -701,26 +701,26 @@ discard block |
||
701 | 701 | public function payments_data() { |
702 | 702 | |
703 | 703 | $per_page = $this->per_page; |
704 | - $orderby = isset( $_GET['orderby'] ) ? urldecode( $_GET['orderby'] ) : 'ID'; |
|
705 | - $order = isset( $_GET['order'] ) ? $_GET['order'] : 'DESC'; |
|
706 | - $user = isset( $_GET['user'] ) ? $_GET['user'] : null; |
|
707 | - $status = isset( $_GET['status'] ) ? $_GET['status'] : give_get_payment_status_keys(); |
|
708 | - $meta_key = isset( $_GET['meta_key'] ) ? $_GET['meta_key'] : null; |
|
709 | - $year = isset( $_GET['year'] ) ? $_GET['year'] : null; |
|
710 | - $month = isset( $_GET['m'] ) ? $_GET['m'] : null; |
|
711 | - $day = isset( $_GET['day'] ) ? $_GET['day'] : null; |
|
712 | - $search = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : null; |
|
713 | - $start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null; |
|
714 | - $end_date = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : $start_date; |
|
715 | - |
|
716 | - if ( ! empty( $search ) ) { |
|
704 | + $orderby = isset($_GET['orderby']) ? urldecode($_GET['orderby']) : 'ID'; |
|
705 | + $order = isset($_GET['order']) ? $_GET['order'] : 'DESC'; |
|
706 | + $user = isset($_GET['user']) ? $_GET['user'] : null; |
|
707 | + $status = isset($_GET['status']) ? $_GET['status'] : give_get_payment_status_keys(); |
|
708 | + $meta_key = isset($_GET['meta_key']) ? $_GET['meta_key'] : null; |
|
709 | + $year = isset($_GET['year']) ? $_GET['year'] : null; |
|
710 | + $month = isset($_GET['m']) ? $_GET['m'] : null; |
|
711 | + $day = isset($_GET['day']) ? $_GET['day'] : null; |
|
712 | + $search = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : null; |
|
713 | + $start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null; |
|
714 | + $end_date = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : $start_date; |
|
715 | + |
|
716 | + if ( ! empty($search)) { |
|
717 | 717 | $status = 'any'; // Force all payment statuses when searching. |
718 | 718 | } |
719 | 719 | |
720 | 720 | $args = array( |
721 | 721 | 'output' => 'payments', |
722 | 722 | 'number' => $per_page, |
723 | - 'page' => isset( $_GET['paged'] ) ? $_GET['paged'] : null, |
|
723 | + 'page' => isset($_GET['paged']) ? $_GET['paged'] : null, |
|
724 | 724 | 'orderby' => $orderby, |
725 | 725 | 'order' => $order, |
726 | 726 | 'user' => $user, |
@@ -734,12 +734,12 @@ discard block |
||
734 | 734 | 'end_date' => $end_date, |
735 | 735 | ); |
736 | 736 | |
737 | - if ( is_string( $search ) && false !== strpos( $search, 'txn:' ) ) { |
|
737 | + if (is_string($search) && false !== strpos($search, 'txn:')) { |
|
738 | 738 | $args['search_in_notes'] = true; |
739 | - $args['s'] = trim( str_replace( 'txn:', '', $args['s'] ) ); |
|
739 | + $args['s'] = trim(str_replace('txn:', '', $args['s'])); |
|
740 | 740 | } |
741 | 741 | |
742 | - $p_query = new Give_Payments_Query( $args ); |
|
742 | + $p_query = new Give_Payments_Query($args); |
|
743 | 743 | |
744 | 744 | return $p_query->get_payments(); |
745 | 745 | |
@@ -759,17 +759,17 @@ discard block |
||
759 | 759 | */ |
760 | 760 | public function prepare_items() { |
761 | 761 | |
762 | - wp_reset_vars( array( 'action', 'payment', 'orderby', 'order', 's' ) ); |
|
762 | + wp_reset_vars(array('action', 'payment', 'orderby', 'order', 's')); |
|
763 | 763 | |
764 | 764 | $columns = $this->get_columns(); |
765 | 765 | $hidden = array(); // No hidden columns. |
766 | 766 | $sortable = $this->get_sortable_columns(); |
767 | 767 | $data = $this->payments_data(); |
768 | - $status = isset( $_GET['status'] ) ? $_GET['status'] : 'any'; |
|
768 | + $status = isset($_GET['status']) ? $_GET['status'] : 'any'; |
|
769 | 769 | |
770 | - $this->_column_headers = array( $columns, $hidden, $sortable ); |
|
770 | + $this->_column_headers = array($columns, $hidden, $sortable); |
|
771 | 771 | |
772 | - switch ( $status ) { |
|
772 | + switch ($status) { |
|
773 | 773 | case 'publish': |
774 | 774 | $total_items = $this->complete_count; |
775 | 775 | break; |
@@ -796,19 +796,19 @@ discard block |
||
796 | 796 | break; |
797 | 797 | default: |
798 | 798 | // Retrieve the count of the non-default-Give status. |
799 | - $count = wp_count_posts( 'give_payment' ); |
|
800 | - $total_items = isset( $count->{$status} ) ? $count->{$status} : 0; |
|
799 | + $count = wp_count_posts('give_payment'); |
|
800 | + $total_items = isset($count->{$status} ) ? $count->{$status} : 0; |
|
801 | 801 | break; |
802 | 802 | } |
803 | 803 | |
804 | 804 | $this->items = $data; |
805 | 805 | |
806 | - $this->set_pagination_args( array( |
|
806 | + $this->set_pagination_args(array( |
|
807 | 807 | 'total_items' => $total_items, |
808 | 808 | // We have to calculate the total number of items. |
809 | 809 | 'per_page' => $this->per_page, |
810 | 810 | // We have to determine how many items to show on a page. |
811 | - 'total_pages' => ceil( $total_items / $this->per_page ), |
|
811 | + 'total_pages' => ceil($total_items / $this->per_page), |
|
812 | 812 | // We have to calculate the total number of pages. |
813 | 813 | ) |
814 | 814 | ); |