@@ -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,14 +25,14 @@ discard block |
||
25 | 25 | */ |
26 | 26 | function give_get_actions() { |
27 | 27 | |
28 | - $_get_action = ! empty( $_GET['give_action'] ) ? $_GET['give_action'] : null; |
|
28 | + $_get_action = ! empty($_GET['give_action']) ? $_GET['give_action'] : null; |
|
29 | 29 | |
30 | 30 | // Add backward compatibility to give-action param ( $_GET or $_POST ) |
31 | - if( doing_action( 'admin_init' ) && empty( $_get_action ) ) { |
|
32 | - $_get_action = ! empty( $_GET['give-action'] ) ? $_GET['give-action'] : null; |
|
31 | + if (doing_action('admin_init') && empty($_get_action)) { |
|
32 | + $_get_action = ! empty($_GET['give-action']) ? $_GET['give-action'] : null; |
|
33 | 33 | } |
34 | 34 | |
35 | - if ( isset( $_get_action ) ) { |
|
35 | + if (isset($_get_action)) { |
|
36 | 36 | /** |
37 | 37 | * Fires in WordPress init or admin init, when give_action is present in $_GET. |
38 | 38 | * |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @param array $_GET Array of HTTP GET variables. |
42 | 42 | */ |
43 | - do_action( "give_{$_get_action}", $_GET ); |
|
43 | + do_action("give_{$_get_action}", $_GET); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | } |
47 | 47 | |
48 | -add_action( 'init', 'give_get_actions' ); |
|
49 | -add_action( 'admin_init', 'give_get_actions' ); |
|
48 | +add_action('init', 'give_get_actions'); |
|
49 | +add_action('admin_init', 'give_get_actions'); |
|
50 | 50 | |
51 | 51 | /** |
52 | 52 | * Hooks Give actions, when present in the $_POST superglobal. Every give_action |
@@ -59,15 +59,15 @@ discard block |
||
59 | 59 | */ |
60 | 60 | function give_post_actions() { |
61 | 61 | |
62 | - $_post_action = ! empty( $_POST['give_action'] ) ? $_POST['give_action'] : null; |
|
62 | + $_post_action = ! empty($_POST['give_action']) ? $_POST['give_action'] : null; |
|
63 | 63 | |
64 | 64 | |
65 | 65 | // Add backward compatibility to give-action param ( $_GET or $_POST ) |
66 | - if( doing_action( 'admin_init' ) && empty( $_post_action ) ) { |
|
67 | - $_post_action = ! empty( $_POST['give-action'] ) ? $_POST['give-action'] : null; |
|
66 | + if (doing_action('admin_init') && empty($_post_action)) { |
|
67 | + $_post_action = ! empty($_POST['give-action']) ? $_POST['give-action'] : null; |
|
68 | 68 | } |
69 | 69 | |
70 | - if ( isset( $_post_action ) ) { |
|
70 | + if (isset($_post_action)) { |
|
71 | 71 | /** |
72 | 72 | * Fires in WordPress init or admin init, when give_action is present in $_POST. |
73 | 73 | * |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | * |
76 | 76 | * @param array $_POST Array of HTTP POST variables. |
77 | 77 | */ |
78 | - do_action( "give_{$_post_action}", $_POST ); |
|
78 | + do_action("give_{$_post_action}", $_POST); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | } |
82 | 82 | |
83 | -add_action( 'init', 'give_post_actions' ); |
|
84 | -add_action( 'admin_init', 'give_post_actions' ); |
|
83 | +add_action('init', 'give_post_actions'); |
|
84 | +add_action('admin_init', 'give_post_actions'); |
|
85 | 85 | |
86 | 86 | /** |
87 | 87 | * Connect WordPress user with Donor. |
@@ -91,27 +91,27 @@ discard block |
||
91 | 91 | * @param array $user_data User Data |
92 | 92 | * @return void |
93 | 93 | */ |
94 | -function give_connect_donor_to_wpuser( $user_id, $user_data ){ |
|
95 | - $donor = new Give_Customer( $user_data['user_email'] ); |
|
94 | +function give_connect_donor_to_wpuser($user_id, $user_data) { |
|
95 | + $donor = new Give_Customer($user_data['user_email']); |
|
96 | 96 | |
97 | 97 | // Validate donor id and check if do nor is already connect to wp user or not. |
98 | - if( $donor->id && ! $donor->user_id ) { |
|
98 | + if ($donor->id && ! $donor->user_id) { |
|
99 | 99 | |
100 | 100 | // Update donor user_id. |
101 | - if( $donor->update( array( 'user_id' => $user_id ) ) ) { |
|
102 | - $donor_note = sprintf( esc_html__( 'WordPress user #%d is connected to #%d', 'give' ), $user_id, $donor->id ); |
|
103 | - $donor->add_note( $donor_note ); |
|
101 | + if ($donor->update(array('user_id' => $user_id))) { |
|
102 | + $donor_note = sprintf(esc_html__('WordPress user #%d is connected to #%d', 'give'), $user_id, $donor->id); |
|
103 | + $donor->add_note($donor_note); |
|
104 | 104 | |
105 | 105 | // Update user_id meta in payments. |
106 | - if( ! empty( $donor->payment_ids ) && ( $donations = explode( ',', $donor->payment_ids ) ) ) { |
|
107 | - foreach ( $donations as $donation ) { |
|
108 | - update_post_meta( $donation, '_give_payment_user_id', $user_id ); |
|
106 | + if ( ! empty($donor->payment_ids) && ($donations = explode(',', $donor->payment_ids))) { |
|
107 | + foreach ($donations as $donation) { |
|
108 | + update_post_meta($donation, '_give_payment_user_id', $user_id); |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | } |
112 | 112 | } |
113 | 113 | } |
114 | -add_action( 'give_insert_user', 'give_connect_donor_to_wpuser', 10, 2 ); |
|
114 | +add_action('give_insert_user', 'give_connect_donor_to_wpuser', 10, 2); |
|
115 | 115 | |
116 | 116 | |
117 | 117 | /** |
@@ -125,24 +125,24 @@ discard block |
||
125 | 125 | function give_validate_license_when_site_migrated() { |
126 | 126 | // Store current site address if not already stored. |
127 | 127 | $homeurl = home_url(); |
128 | - if( ! get_option( 'give_site_address_before_migrate' ) ) { |
|
128 | + if ( ! get_option('give_site_address_before_migrate')) { |
|
129 | 129 | // Update site address. |
130 | - update_option( 'give_site_address_before_migrate', $homeurl ); |
|
130 | + update_option('give_site_address_before_migrate', $homeurl); |
|
131 | 131 | |
132 | 132 | return; |
133 | 133 | } |
134 | 134 | |
135 | - if( $homeurl !== get_option( 'give_site_address_before_migrate' ) ) { |
|
135 | + if ($homeurl !== get_option('give_site_address_before_migrate')) { |
|
136 | 136 | // Immediately run cron. |
137 | - wp_schedule_single_event( time() , 'give_validate_license_when_site_migrated' ); |
|
137 | + wp_schedule_single_event(time(), 'give_validate_license_when_site_migrated'); |
|
138 | 138 | |
139 | 139 | // Update site address. |
140 | - update_option( 'give_site_address_before_migrate', home_url() ); |
|
140 | + update_option('give_site_address_before_migrate', home_url()); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | } |
144 | -add_action( 'init', 'give_validate_license_when_site_migrated' ); |
|
145 | -add_action( 'admin_init', 'give_validate_license_when_site_migrated' ); |
|
144 | +add_action('init', 'give_validate_license_when_site_migrated'); |
|
145 | +add_action('admin_init', 'give_validate_license_when_site_migrated'); |
|
146 | 146 | |
147 | 147 | |
148 | 148 | /** |
@@ -151,15 +151,15 @@ discard block |
||
151 | 151 | * @since 1.8 |
152 | 152 | * @param $data |
153 | 153 | */ |
154 | -function give_donor_batch_export_complete( $data ) { |
|
154 | +function give_donor_batch_export_complete($data) { |
|
155 | 155 | // Remove donor ids cache. |
156 | - if( |
|
157 | - isset( $data['class'] ) |
|
156 | + if ( |
|
157 | + isset($data['class']) |
|
158 | 158 | && 'Give_Batch_Customers_Export' === $data['class'] |
159 | - && ! empty( $data['forms'] ) |
|
160 | - && isset( $data['give_export_option']['query_id'] ) |
|
159 | + && ! empty($data['forms']) |
|
160 | + && isset($data['give_export_option']['query_id']) |
|
161 | 161 | ) { |
162 | - delete_transient( $data['give_export_option']['query_id'] ); |
|
162 | + delete_transient($data['give_export_option']['query_id']); |
|
163 | 163 | } |
164 | 164 | } |
165 | -add_action('give_file_export_complete', 'give_donor_batch_export_complete' ); |
|
165 | +add_action('give_file_export_complete', 'give_donor_batch_export_complete'); |
@@ -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_Page' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Page')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Page. |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | // Get current setting page. |
63 | 63 | $this->current_setting_page = give_get_current_setting_page(); |
64 | 64 | |
65 | - add_filter( "give_default_setting_tab_section_{$this->id}", array( $this, 'set_default_setting_tab' ), 10 ); |
|
66 | - add_filter( "{$this->current_setting_page}_tabs_array", array( $this, 'add_settings_page' ), 20 ); |
|
67 | - add_action( "{$this->current_setting_page}_sections_{$this->id}_page", array( $this, 'output_sections' ) ); |
|
68 | - add_action( "{$this->current_setting_page}_settings_{$this->id}_page", array( $this, 'output' ) ); |
|
69 | - add_action( "{$this->current_setting_page}_save_{$this->id}", array( $this, 'save' ) ); |
|
65 | + add_filter("give_default_setting_tab_section_{$this->id}", array($this, 'set_default_setting_tab'), 10); |
|
66 | + add_filter("{$this->current_setting_page}_tabs_array", array($this, 'add_settings_page'), 20); |
|
67 | + add_action("{$this->current_setting_page}_sections_{$this->id}_page", array($this, 'output_sections')); |
|
68 | + add_action("{$this->current_setting_page}_settings_{$this->id}_page", array($this, 'output')); |
|
69 | + add_action("{$this->current_setting_page}_save_{$this->id}", array($this, 'save')); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * |
79 | 79 | * @return string |
80 | 80 | */ |
81 | - function set_default_setting_tab( $setting_tab ) { |
|
81 | + function set_default_setting_tab($setting_tab) { |
|
82 | 82 | return $this->default_tab; |
83 | 83 | } |
84 | 84 | |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | * |
92 | 92 | * @return array |
93 | 93 | */ |
94 | - public function add_settings_page( $pages ) { |
|
95 | - $pages[ $this->id ] = $this->label; |
|
94 | + public function add_settings_page($pages) { |
|
95 | + $pages[$this->id] = $this->label; |
|
96 | 96 | |
97 | 97 | return $pages; |
98 | 98 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * |
112 | 112 | * @param array $settings |
113 | 113 | */ |
114 | - $settings = apply_filters( 'give_get_settings_' . $this->id, array() ); |
|
114 | + $settings = apply_filters('give_get_settings_'.$this->id, array()); |
|
115 | 115 | |
116 | 116 | // Output. |
117 | 117 | return $settings; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * @return array |
125 | 125 | */ |
126 | 126 | public function get_sections() { |
127 | - return apply_filters( 'give_get_sections_' . $this->id, array() ); |
|
127 | + return apply_filters('give_get_sections_'.$this->id, array()); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
@@ -141,29 +141,29 @@ discard block |
||
141 | 141 | $sections = $this->get_sections(); |
142 | 142 | |
143 | 143 | // Show section settings only if setting section exist. |
144 | - if ( $current_section && ! in_array( $current_section, array_keys( $sections ) ) ) { |
|
145 | - echo '<div class="error"><p>' . __( 'Oops, this settings page does not exist.', 'give' ) . '</p></div>'; |
|
144 | + if ($current_section && ! in_array($current_section, array_keys($sections))) { |
|
145 | + echo '<div class="error"><p>'.__('Oops, this settings page does not exist.', 'give').'</p></div>'; |
|
146 | 146 | $GLOBALS['give_hide_save_button'] = true; |
147 | 147 | |
148 | 148 | return; |
149 | 149 | } |
150 | 150 | |
151 | 151 | // Bailout. |
152 | - if ( empty( $sections ) ) { |
|
152 | + if (empty($sections)) { |
|
153 | 153 | return; |
154 | 154 | } |
155 | 155 | |
156 | - if ( is_null( $this->current_setting_page ) ) { |
|
156 | + if (is_null($this->current_setting_page)) { |
|
157 | 157 | $this->current_setting_page = give_get_current_setting_page(); |
158 | 158 | } |
159 | 159 | |
160 | 160 | echo '<ul class="subsubsub">'; |
161 | 161 | |
162 | 162 | // Get section keys. |
163 | - $array_keys = array_keys( $sections ); |
|
163 | + $array_keys = array_keys($sections); |
|
164 | 164 | |
165 | - foreach ( $sections as $id => $label ) { |
|
166 | - echo '<li><a href="' . admin_url( 'edit.php?post_type=give_forms&page=' . $this->current_setting_page . '&tab=' . $this->id . '§ion=' . sanitize_title( $id ) ) . '" class="' . ( $current_section == $id ? 'current' : '' ) . '">' . $label . '</a> ' . ( end( $array_keys ) == $id ? '' : '|' ) . ' </li>'; |
|
165 | + foreach ($sections as $id => $label) { |
|
166 | + echo '<li><a href="'.admin_url('edit.php?post_type=give_forms&page='.$this->current_setting_page.'&tab='.$this->id.'§ion='.sanitize_title($id)).'" class="'.($current_section == $id ? 'current' : '').'">'.$label.'</a> '.(end($array_keys) == $id ? '' : '|').' </li>'; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | echo '</ul><br class="clear" /><hr>'; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | public function output() { |
179 | 179 | $settings = $this->get_settings(); |
180 | 180 | |
181 | - Give_Admin_Settings::output_fields( $settings, 'give_settings' ); |
|
181 | + Give_Admin_Settings::output_fields($settings, 'give_settings'); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | /** |
@@ -191,14 +191,14 @@ discard block |
||
191 | 191 | $settings = $this->get_settings(); |
192 | 192 | $current_section = give_get_current_setting_section(); |
193 | 193 | |
194 | - Give_Admin_Settings::save_fields( $settings, 'give_settings' ); |
|
194 | + Give_Admin_Settings::save_fields($settings, 'give_settings'); |
|
195 | 195 | |
196 | 196 | /** |
197 | 197 | * Trigger Action |
198 | 198 | * |
199 | 199 | * @since 1.8 |
200 | 200 | */ |
201 | - do_action( 'give_update_options_' . $this->id . '_' . $current_section ); |
|
201 | + do_action('give_update_options_'.$this->id.'_'.$current_section); |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 |
@@ -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_Export' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Export')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Export. |
@@ -43,16 +43,16 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function __construct() { |
45 | 45 | $this->id = 'export'; |
46 | - $this->label = esc_html__( 'Export', 'give' ); |
|
46 | + $this->label = esc_html__('Export', 'give'); |
|
47 | 47 | |
48 | - add_filter( 'give-reports_tabs_array', array( $this, 'add_settings_page' ), 20 ); |
|
49 | - add_action( "give-reports_settings_{$this->id}_page", array( $this, 'output' ) ); |
|
50 | - add_action( 'give_admin_field_report_export', array( $this, 'render_report_export_field' ), 10, 2 ); |
|
48 | + add_filter('give-reports_tabs_array', array($this, 'add_settings_page'), 20); |
|
49 | + add_action("give-reports_settings_{$this->id}_page", array($this, 'output')); |
|
50 | + add_action('give_admin_field_report_export', array($this, 'render_report_export_field'), 10, 2); |
|
51 | 51 | |
52 | 52 | // Do not use main donor for this tab. |
53 | - if( give_get_current_setting_tab() === $this->id ) { |
|
54 | - add_action( 'give-reports_open_form', '__return_empty_string' ); |
|
55 | - add_action( 'give-reports_close_form', '__return_empty_string' ); |
|
53 | + if (give_get_current_setting_tab() === $this->id) { |
|
54 | + add_action('give-reports_open_form', '__return_empty_string'); |
|
55 | + add_action('give-reports_close_form', '__return_empty_string'); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | * @param array $pages Lst of pages. |
64 | 64 | * @return array |
65 | 65 | */ |
66 | - public function add_settings_page( $pages ) { |
|
67 | - $pages[ $this->id ] = $this->label; |
|
66 | + public function add_settings_page($pages) { |
|
67 | + $pages[$this->id] = $this->label; |
|
68 | 68 | |
69 | 69 | return $pages; |
70 | 70 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @param array $settings |
87 | 87 | */ |
88 | 88 | $settings = apply_filters( |
89 | - 'give_get_settings_' . $this->id, |
|
89 | + 'give_get_settings_'.$this->id, |
|
90 | 90 | array( |
91 | 91 | array( |
92 | 92 | 'id' => 'give_reports_export', |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | ), |
96 | 96 | array( |
97 | 97 | 'id' => 'export', |
98 | - 'name' => esc_html__( 'Export', 'give' ), |
|
98 | + 'name' => esc_html__('Export', 'give'), |
|
99 | 99 | 'type' => 'report_export', |
100 | 100 | ), |
101 | 101 | array( |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | public function output() { |
120 | 120 | $settings = $this->get_settings(); |
121 | 121 | |
122 | - Give_Admin_Settings::output_fields( $settings, 'give_settings' ); |
|
122 | + Give_Admin_Settings::output_fields($settings, 'give_settings'); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | * @param $field |
132 | 132 | * @param $option_value |
133 | 133 | */ |
134 | - public function render_report_export_field( $field, $option_value ) { |
|
135 | - do_action( 'give_reports_tab_export'); |
|
134 | + public function render_report_export_field($field, $option_value) { |
|
135 | + do_action('give_reports_tab_export'); |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 |
@@ -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_Gateways' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Gateways')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Gateways. |
@@ -43,16 +43,16 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function __construct() { |
45 | 45 | $this->id = 'gateways'; |
46 | - $this->label = esc_html__( 'Donation Methods', 'give' ); |
|
46 | + $this->label = esc_html__('Donation Methods', 'give'); |
|
47 | 47 | |
48 | - add_filter( 'give-reports_tabs_array', array( $this, 'add_settings_page' ), 20 ); |
|
49 | - add_action( "give-reports_settings_{$this->id}_page", array( $this, 'output' ) ); |
|
50 | - add_action( 'give_admin_field_report_gateways', array( $this, 'render_report_gateways_field' ), 10, 2 ); |
|
48 | + add_filter('give-reports_tabs_array', array($this, 'add_settings_page'), 20); |
|
49 | + add_action("give-reports_settings_{$this->id}_page", array($this, 'output')); |
|
50 | + add_action('give_admin_field_report_gateways', array($this, 'render_report_gateways_field'), 10, 2); |
|
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-reports_open_form', '__return_empty_string' ); |
|
55 | - add_action( 'give-reports_close_form', '__return_empty_string' ); |
|
53 | + if (give_get_current_setting_tab() === $this->id) { |
|
54 | + add_action('give-reports_open_form', '__return_empty_string'); |
|
55 | + add_action('give-reports_close_form', '__return_empty_string'); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | * @param array $pages Lst of pages. |
64 | 64 | * @return array |
65 | 65 | */ |
66 | - public function add_settings_page( $pages ) { |
|
67 | - $pages[ $this->id ] = $this->label; |
|
66 | + public function add_settings_page($pages) { |
|
67 | + $pages[$this->id] = $this->label; |
|
68 | 68 | |
69 | 69 | return $pages; |
70 | 70 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @param array $settings |
87 | 87 | */ |
88 | 88 | $settings = apply_filters( |
89 | - 'give_get_settings_' . $this->id, |
|
89 | + 'give_get_settings_'.$this->id, |
|
90 | 90 | array( |
91 | 91 | array( |
92 | 92 | 'id' => 'give_reports_gateways', |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | ), |
96 | 96 | array( |
97 | 97 | 'id' => 'gateways', |
98 | - 'name' => esc_html__( 'Gateways', 'give' ), |
|
98 | + 'name' => esc_html__('Gateways', 'give'), |
|
99 | 99 | 'type' => 'report_gateways', |
100 | 100 | ), |
101 | 101 | array( |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | public function output() { |
120 | 120 | $settings = $this->get_settings(); |
121 | 121 | |
122 | - Give_Admin_Settings::output_fields( $settings, 'give_settings' ); |
|
122 | + Give_Admin_Settings::output_fields($settings, 'give_settings'); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | * @param $field |
132 | 132 | * @param $option_value |
133 | 133 | */ |
134 | - public function render_report_gateways_field( $field, $option_value ) { |
|
135 | - do_action( 'give_reports_view_gateways'); |
|
134 | + public function render_report_gateways_field($field, $option_value) { |
|
135 | + do_action('give_reports_view_gateways'); |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 |
@@ -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_Donors' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Donors')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Donors. |
@@ -43,16 +43,16 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function __construct() { |
45 | 45 | $this->id = 'donors'; |
46 | - $this->label = esc_html__( 'Donors', 'give' ); |
|
46 | + $this->label = esc_html__('Donors', 'give'); |
|
47 | 47 | |
48 | - add_filter( 'give-reports_tabs_array', array( $this, 'add_settings_page' ), 20 ); |
|
49 | - add_action( "give-reports_settings_{$this->id}_page", array( $this, 'output' ) ); |
|
50 | - add_action( 'give_admin_field_report_donors', array( $this, 'render_report_donors_field' ), 10, 2 ); |
|
48 | + add_filter('give-reports_tabs_array', array($this, 'add_settings_page'), 20); |
|
49 | + add_action("give-reports_settings_{$this->id}_page", array($this, 'output')); |
|
50 | + add_action('give_admin_field_report_donors', array($this, 'render_report_donors_field'), 10, 2); |
|
51 | 51 | |
52 | 52 | // Do not use main donor for this tab. |
53 | - if( give_get_current_setting_tab() === $this->id ) { |
|
54 | - add_action( 'give-reports_open_form', '__return_empty_string' ); |
|
55 | - add_action( 'give-reports_close_form', '__return_empty_string' ); |
|
53 | + if (give_get_current_setting_tab() === $this->id) { |
|
54 | + add_action('give-reports_open_form', '__return_empty_string'); |
|
55 | + add_action('give-reports_close_form', '__return_empty_string'); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | * @param array $pages Lst of pages. |
64 | 64 | * @return array |
65 | 65 | */ |
66 | - public function add_settings_page( $pages ) { |
|
67 | - $pages[ $this->id ] = $this->label; |
|
66 | + public function add_settings_page($pages) { |
|
67 | + $pages[$this->id] = $this->label; |
|
68 | 68 | |
69 | 69 | return $pages; |
70 | 70 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @param array $settings |
87 | 87 | */ |
88 | 88 | $settings = apply_filters( |
89 | - 'give_get_settings_' . $this->id, |
|
89 | + 'give_get_settings_'.$this->id, |
|
90 | 90 | array( |
91 | 91 | array( |
92 | 92 | 'id' => 'give_reports_donors', |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | ), |
96 | 96 | array( |
97 | 97 | 'id' => 'donors', |
98 | - 'name' => esc_html__( 'Donors', 'give' ), |
|
98 | + 'name' => esc_html__('Donors', 'give'), |
|
99 | 99 | 'type' => 'report_donors', |
100 | 100 | ), |
101 | 101 | array( |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | public function output() { |
120 | 120 | $settings = $this->get_settings(); |
121 | 121 | |
122 | - Give_Admin_Settings::output_fields( $settings, 'give_settings' ); |
|
122 | + Give_Admin_Settings::output_fields($settings, 'give_settings'); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | * @param $field |
132 | 132 | * @param $option_value |
133 | 133 | */ |
134 | - public function render_report_donors_field( $field, $option_value ) { |
|
135 | - do_action( 'give_reports_view_donors'); |
|
134 | + public function render_report_donors_field($field, $option_value) { |
|
135 | + do_action('give_reports_view_donors'); |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 |
@@ -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_Forms' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Forms')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Forms. |
@@ -43,16 +43,16 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function __construct() { |
45 | 45 | $this->id = 'forms'; |
46 | - $this->label = esc_html__( 'Forms', 'give' ); |
|
46 | + $this->label = esc_html__('Forms', 'give'); |
|
47 | 47 | |
48 | - add_filter( 'give-reports_tabs_array', array( $this, 'add_settings_page' ), 20 ); |
|
49 | - add_action( "give-reports_settings_{$this->id}_page", array( $this, 'output' ) ); |
|
50 | - add_action( 'give_admin_field_report_forms', array( $this, 'render_report_forms_field' ), 10, 2 ); |
|
48 | + add_filter('give-reports_tabs_array', array($this, 'add_settings_page'), 20); |
|
49 | + add_action("give-reports_settings_{$this->id}_page", array($this, 'output')); |
|
50 | + add_action('give_admin_field_report_forms', array($this, 'render_report_forms_field'), 10, 2); |
|
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-reports_open_form', '__return_empty_string' ); |
|
55 | - add_action( 'give-reports_close_form', '__return_empty_string' ); |
|
53 | + if (give_get_current_setting_tab() === $this->id) { |
|
54 | + add_action('give-reports_open_form', '__return_empty_string'); |
|
55 | + add_action('give-reports_close_form', '__return_empty_string'); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | * @param array $pages Lst of pages. |
64 | 64 | * @return array |
65 | 65 | */ |
66 | - public function add_settings_page( $pages ) { |
|
67 | - $pages[ $this->id ] = $this->label; |
|
66 | + public function add_settings_page($pages) { |
|
67 | + $pages[$this->id] = $this->label; |
|
68 | 68 | |
69 | 69 | return $pages; |
70 | 70 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @param array $settings |
87 | 87 | */ |
88 | 88 | $settings = apply_filters( |
89 | - 'give_get_settings_' . $this->id, |
|
89 | + 'give_get_settings_'.$this->id, |
|
90 | 90 | array( |
91 | 91 | array( |
92 | 92 | 'id' => 'give_reports_forms', |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | ), |
96 | 96 | array( |
97 | 97 | 'id' => 'forms', |
98 | - 'name' => esc_html__( 'Forms', 'give' ), |
|
98 | + 'name' => esc_html__('Forms', 'give'), |
|
99 | 99 | 'type' => 'report_forms', |
100 | 100 | ), |
101 | 101 | array( |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | public function output() { |
120 | 120 | $settings = $this->get_settings(); |
121 | 121 | |
122 | - Give_Admin_Settings::output_fields( $settings, 'give_settings' ); |
|
122 | + Give_Admin_Settings::output_fields($settings, 'give_settings'); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | * @param $field |
132 | 132 | * @param $option_value |
133 | 133 | */ |
134 | - public function render_report_forms_field( $field, $option_value ) { |
|
135 | - do_action( 'give_reports_view_forms'); |
|
134 | + public function render_report_forms_field($field, $option_value) { |
|
135 | + do_action('give_reports_view_forms'); |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | |
14 | 14 | // Exit if accessed directly. |
15 | -if ( ! defined( 'ABSPATH' ) ) { |
|
15 | +if ( ! defined('ABSPATH')) { |
|
16 | 16 | exit; |
17 | 17 | } |
18 | 18 | |
@@ -106,14 +106,14 @@ discard block |
||
106 | 106 | * @param $_step int The step to process |
107 | 107 | * @since 1.5 |
108 | 108 | */ |
109 | - public function __construct( $_step = 1 ) { |
|
109 | + public function __construct($_step = 1) { |
|
110 | 110 | |
111 | 111 | $upload_dir = wp_upload_dir(); |
112 | 112 | $this->filetype = '.csv'; |
113 | - $this->filename = 'give-' . $this->export_type . $this->filetype; |
|
114 | - $this->file = trailingslashit( $upload_dir['basedir'] ) . $this->filename; |
|
113 | + $this->filename = 'give-'.$this->export_type.$this->filetype; |
|
114 | + $this->file = trailingslashit($upload_dir['basedir']).$this->filename; |
|
115 | 115 | |
116 | - if ( ! is_writeable( $upload_dir['basedir'] ) ) { |
|
116 | + if ( ! is_writeable($upload_dir['basedir'])) { |
|
117 | 117 | $this->is_writable = false; |
118 | 118 | } |
119 | 119 | |
@@ -129,20 +129,20 @@ discard block |
||
129 | 129 | */ |
130 | 130 | public function process_step() { |
131 | 131 | |
132 | - if ( ! $this->can_export() ) { |
|
133 | - wp_die( esc_html__( 'You do not have permission to export data.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
132 | + if ( ! $this->can_export()) { |
|
133 | + wp_die(esc_html__('You do not have permission to export data.', 'give'), esc_html__('Error', 'give'), array('response' => 403)); |
|
134 | 134 | } |
135 | 135 | |
136 | - if( $this->step < 2 ) { |
|
136 | + if ($this->step < 2) { |
|
137 | 137 | |
138 | 138 | // Make sure we start with a fresh file on step 1 |
139 | - @unlink( $this->file ); |
|
139 | + @unlink($this->file); |
|
140 | 140 | $this->print_csv_cols(); |
141 | 141 | } |
142 | 142 | |
143 | 143 | $rows = $this->print_csv_rows(); |
144 | 144 | |
145 | - if( $rows ) { |
|
145 | + if ($rows) { |
|
146 | 146 | return true; |
147 | 147 | } else { |
148 | 148 | return false; |
@@ -162,14 +162,14 @@ discard block |
||
162 | 162 | $col_data = ''; |
163 | 163 | $cols = $this->get_csv_cols(); |
164 | 164 | $i = 1; |
165 | - foreach( $cols as $col_id => $column ) { |
|
166 | - $col_data .= '"' . addslashes( $column ) . '"'; |
|
167 | - $col_data .= $i == count( $cols ) ? '' : ','; |
|
165 | + foreach ($cols as $col_id => $column) { |
|
166 | + $col_data .= '"'.addslashes($column).'"'; |
|
167 | + $col_data .= $i == count($cols) ? '' : ','; |
|
168 | 168 | $i++; |
169 | 169 | } |
170 | 170 | $col_data .= "\r\n"; |
171 | 171 | |
172 | - $this->stash_step_data( $col_data ); |
|
172 | + $this->stash_step_data($col_data); |
|
173 | 173 | |
174 | 174 | return $col_data; |
175 | 175 | |
@@ -188,23 +188,23 @@ discard block |
||
188 | 188 | $data = $this->get_data(); |
189 | 189 | $cols = $this->get_csv_cols(); |
190 | 190 | |
191 | - if( $data ) { |
|
191 | + if ($data) { |
|
192 | 192 | |
193 | 193 | // Output each row |
194 | - foreach ( $data as $row ) { |
|
194 | + foreach ($data as $row) { |
|
195 | 195 | $i = 1; |
196 | - foreach ( $row as $col_id => $column ) { |
|
196 | + foreach ($row as $col_id => $column) { |
|
197 | 197 | // Make sure the column is valid |
198 | - if ( array_key_exists( $col_id, $cols ) ) { |
|
199 | - $row_data .= '"' . addslashes( preg_replace( "/\"/","'", $column ) ) . '"'; |
|
200 | - $row_data .= $i == count( $cols ) ? '' : ','; |
|
198 | + if (array_key_exists($col_id, $cols)) { |
|
199 | + $row_data .= '"'.addslashes(preg_replace("/\"/", "'", $column)).'"'; |
|
200 | + $row_data .= $i == count($cols) ? '' : ','; |
|
201 | 201 | $i++; |
202 | 202 | } |
203 | 203 | } |
204 | 204 | $row_data .= "\r\n"; |
205 | 205 | } |
206 | 206 | |
207 | - $this->stash_step_data( $row_data ); |
|
207 | + $this->stash_step_data($row_data); |
|
208 | 208 | |
209 | 209 | return $row_data; |
210 | 210 | } |
@@ -232,18 +232,18 @@ discard block |
||
232 | 232 | |
233 | 233 | $file = ''; |
234 | 234 | |
235 | - if ( @file_exists( $this->file ) ) { |
|
235 | + if (@file_exists($this->file)) { |
|
236 | 236 | |
237 | - if ( ! is_writeable( $this->file ) ) { |
|
237 | + if ( ! is_writeable($this->file)) { |
|
238 | 238 | $this->is_writable = false; |
239 | 239 | } |
240 | 240 | |
241 | - $file = @file_get_contents( $this->file ); |
|
241 | + $file = @file_get_contents($this->file); |
|
242 | 242 | |
243 | 243 | } else { |
244 | 244 | |
245 | - @file_put_contents( $this->file, '' ); |
|
246 | - @chmod( $this->file, 0664 ); |
|
245 | + @file_put_contents($this->file, ''); |
|
246 | + @chmod($this->file, 0664); |
|
247 | 247 | |
248 | 248 | } |
249 | 249 | |
@@ -257,18 +257,18 @@ discard block |
||
257 | 257 | * @param $data string The data to add to the file |
258 | 258 | * @return void |
259 | 259 | */ |
260 | - protected function stash_step_data( $data = '' ) { |
|
260 | + protected function stash_step_data($data = '') { |
|
261 | 261 | |
262 | 262 | $file = $this->get_file(); |
263 | 263 | $file .= $data; |
264 | - @file_put_contents( $this->file, $file ); |
|
264 | + @file_put_contents($this->file, $file); |
|
265 | 265 | |
266 | 266 | // If we have no rows after this step, mark it as an empty export |
267 | - $file_rows = file( $this->file, FILE_SKIP_EMPTY_LINES); |
|
267 | + $file_rows = file($this->file, FILE_SKIP_EMPTY_LINES); |
|
268 | 268 | $default_cols = $this->get_csv_cols(); |
269 | - $default_cols = empty( $default_cols ) ? 0 : 1; |
|
269 | + $default_cols = empty($default_cols) ? 0 : 1; |
|
270 | 270 | |
271 | - $this->is_empty = count( $file_rows ) == $default_cols ? true : false; |
|
271 | + $this->is_empty = count($file_rows) == $default_cols ? true : false; |
|
272 | 272 | |
273 | 273 | } |
274 | 274 | |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | |
287 | 287 | $file = $this->get_file(); |
288 | 288 | |
289 | - @unlink( $this->file ); |
|
289 | + @unlink($this->file); |
|
290 | 290 | |
291 | 291 | echo $file; |
292 | 292 | |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | * |
296 | 296 | * @since 1.8 |
297 | 297 | */ |
298 | - do_action( 'give_file_export_complete', $_REQUEST ); |
|
298 | + do_action('give_file_export_complete', $_REQUEST); |
|
299 | 299 | |
300 | 300 | give_die(); |
301 | 301 | } |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | * @since 1.5 |
307 | 307 | * @param array $request The Form Data passed into the batch processing |
308 | 308 | */ |
309 | - public function set_properties( $request ) {} |
|
309 | + public function set_properties($request) {} |
|
310 | 310 | |
311 | 311 | /** |
312 | 312 | * Allow for prefetching of data for the remainder of the exporter |
@@ -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_Earnings' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Earnings')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Earnings. |
@@ -43,16 +43,16 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function __construct() { |
45 | 45 | $this->id = 'earnings'; |
46 | - $this->label = esc_html__( 'Income', 'give' ); |
|
46 | + $this->label = esc_html__('Income', 'give'); |
|
47 | 47 | |
48 | - add_filter( 'give-reports_tabs_array', array( $this, 'add_settings_page' ), 20 ); |
|
49 | - add_action( "give-reports_settings_{$this->id}_page", array( $this, 'output' ) ); |
|
50 | - add_action( 'give_admin_field_report_earnings', array( $this, 'render_report_earnings_field' ), 10, 2 ); |
|
48 | + add_filter('give-reports_tabs_array', array($this, 'add_settings_page'), 20); |
|
49 | + add_action("give-reports_settings_{$this->id}_page", array($this, 'output')); |
|
50 | + add_action('give_admin_field_report_earnings', array($this, 'render_report_earnings_field'), 10, 2); |
|
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-reports_open_form', '__return_empty_string' ); |
|
55 | - add_action( 'give-reports_close_form', '__return_empty_string' ); |
|
53 | + if (give_get_current_setting_tab() === $this->id) { |
|
54 | + add_action('give-reports_open_form', '__return_empty_string'); |
|
55 | + add_action('give-reports_close_form', '__return_empty_string'); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | * @param array $pages Lst of pages. |
64 | 64 | * @return array |
65 | 65 | */ |
66 | - public function add_settings_page( $pages ) { |
|
67 | - $pages[ $this->id ] = $this->label; |
|
66 | + public function add_settings_page($pages) { |
|
67 | + $pages[$this->id] = $this->label; |
|
68 | 68 | |
69 | 69 | return $pages; |
70 | 70 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @param array $settings |
87 | 87 | */ |
88 | 88 | $settings = apply_filters( |
89 | - 'give_get_settings_' . $this->id, |
|
89 | + 'give_get_settings_'.$this->id, |
|
90 | 90 | array( |
91 | 91 | array( |
92 | 92 | 'id' => 'give_tools_earnings', |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | ), |
96 | 96 | array( |
97 | 97 | 'id' => 'earnings', |
98 | - 'name' => esc_html__( 'Income', 'give' ), |
|
98 | + 'name' => esc_html__('Income', 'give'), |
|
99 | 99 | 'type' => 'report_earnings', |
100 | 100 | ), |
101 | 101 | array( |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | public function output() { |
120 | 120 | $settings = $this->get_settings(); |
121 | 121 | |
122 | - Give_Admin_Settings::output_fields( $settings, 'give_settings' ); |
|
122 | + Give_Admin_Settings::output_fields($settings, 'give_settings'); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | * @param $field |
132 | 132 | * @param $option_value |
133 | 133 | */ |
134 | - public function render_report_earnings_field( $field, $option_value ) { |
|
135 | - do_action( 'give_reports_view_earnings' ); |
|
134 | + public function render_report_earnings_field($field, $option_value) { |
|
135 | + do_action('give_reports_view_earnings'); |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 |
@@ -2,13 +2,13 @@ discard block |
||
2 | 2 | /** |
3 | 3 | * Admin View: Settings |
4 | 4 | */ |
5 | -if ( ! defined( 'ABSPATH' ) ) { |
|
5 | +if ( ! defined('ABSPATH')) { |
|
6 | 6 | exit; |
7 | 7 | } |
8 | 8 | |
9 | 9 | |
10 | 10 | // Bailout: Do not output anything if setting tab is not defined. |
11 | -if( ! empty( $tabs ) && array_key_exists( give_get_current_setting_tab(), $tabs ) ) : |
|
11 | +if ( ! empty($tabs) && array_key_exists(give_get_current_setting_tab(), $tabs)) : |
|
12 | 12 | /** |
13 | 13 | * Filter the form action. |
14 | 14 | * |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * |
19 | 19 | * @since 1.8 |
20 | 20 | */ |
21 | - $form_method = apply_filters( self::$setting_filter_prefix . '_form_method_tab_' . $current_tab, 'post' ); |
|
21 | + $form_method = apply_filters(self::$setting_filter_prefix.'_form_method_tab_'.$current_tab, 'post'); |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Filter the main form tab. |
@@ -30,15 +30,15 @@ discard block |
||
30 | 30 | * |
31 | 31 | * @since 1.8 |
32 | 32 | */ |
33 | - $form_open_tag = apply_filters( self::$setting_filter_prefix . '_open_form', '<form method="' . $form_method . '" id="give-mainform" action="" enctype="multipart/form-data">' ); |
|
34 | - $form_close_tag = apply_filters( self::$setting_filter_prefix . '_close_form', '</form>' ); |
|
33 | + $form_open_tag = apply_filters(self::$setting_filter_prefix.'_open_form', '<form method="'.$form_method.'" id="give-mainform" action="" enctype="multipart/form-data">'); |
|
34 | + $form_close_tag = apply_filters(self::$setting_filter_prefix.'_close_form', '</form>'); |
|
35 | 35 | ?> |
36 | - <div class="wrap give-settings-page <?php echo self::$setting_filter_prefix . '-setting-page'; ?>"> |
|
36 | + <div class="wrap give-settings-page <?php echo self::$setting_filter_prefix.'-setting-page'; ?>"> |
|
37 | 37 | <?php echo $form_open_tag; ?> |
38 | 38 | <h2 class="nav-tab-wrapper give-nav-tab-wrapper"> |
39 | 39 | <?php |
40 | - foreach ( $tabs as $name => $label ) { |
|
41 | - echo '<a href="' . admin_url( "edit.php?post_type=give_forms&page=" . self::$setting_filter_prefix . "&tab={$name}" ) . '" class="nav-tab ' . ( $current_tab == $name ? 'nav-tab-active' : '' ) . '">' . $label . '</a>'; |
|
40 | + foreach ($tabs as $name => $label) { |
|
41 | + echo '<a href="'.admin_url("edit.php?post_type=give_forms&page=".self::$setting_filter_prefix."&tab={$name}").'" class="nav-tab '.($current_tab == $name ? 'nav-tab-active' : '').'">'.$label.'</a>'; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | * |
51 | 51 | * @since 1.8 |
52 | 52 | */ |
53 | - do_action( self::$setting_filter_prefix . '_tabs' ); |
|
53 | + do_action(self::$setting_filter_prefix.'_tabs'); |
|
54 | 54 | ?> |
55 | 55 | </h2> |
56 | 56 | <div class="give-sub-nav-tab-wrapper"> |
57 | - <a href="#" id="give-show-sub-nav" class="nav-tab give-not-tab" title="<?php _e( 'View remaining setting tabs', 'give' ); ?>"><span class="dashicons dashicons-arrow-down-alt2"></span></span></a> |
|
57 | + <a href="#" id="give-show-sub-nav" class="nav-tab give-not-tab" title="<?php _e('View remaining setting tabs', 'give'); ?>"><span class="dashicons dashicons-arrow-down-alt2"></span></span></a> |
|
58 | 58 | <nav class="give-sub-nav-tab give-hidden"></nav> |
59 | 59 | </div> |
60 | - <h1 class="screen-reader-text"><?php echo esc_html( $tabs[ $current_tab ] ); ?></h1> |
|
60 | + <h1 class="screen-reader-text"><?php echo esc_html($tabs[$current_tab]); ?></h1> |
|
61 | 61 | <?php |
62 | 62 | |
63 | 63 | /** |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @since 1.8 |
71 | 71 | */ |
72 | - do_action( self::$setting_filter_prefix . "_sections_{$current_tab}_page" ); |
|
72 | + do_action(self::$setting_filter_prefix."_sections_{$current_tab}_page"); |
|
73 | 73 | |
74 | 74 | |
75 | 75 | // Show messages. |
@@ -85,15 +85,15 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @since 1.8 |
87 | 87 | */ |
88 | - do_action( self::$setting_filter_prefix . "_settings_{$current_tab}_page" ); |
|
88 | + do_action(self::$setting_filter_prefix."_settings_{$current_tab}_page"); |
|
89 | 89 | |
90 | - if ( empty( $GLOBALS['give_hide_save_button'] ) ) : ?> |
|
90 | + if (empty($GLOBALS['give_hide_save_button'])) : ?> |
|
91 | 91 | <div class="give-submit-wrap"> |
92 | - <?php wp_nonce_field( 'give-save-settings', '_give-save-settings' ); ?> |
|
93 | - <input name="save" class="button-primary give-save-button" type="submit" value="<?php esc_attr_e( 'Save changes', 'give' ); ?>" /> |
|
92 | + <?php wp_nonce_field('give-save-settings', '_give-save-settings'); ?> |
|
93 | + <input name="save" class="button-primary give-save-button" type="submit" value="<?php esc_attr_e('Save changes', 'give'); ?>" /> |
|
94 | 94 | </div> |
95 | 95 | <?php endif; ?> |
96 | 96 | <?php echo $form_close_tag; ?> |
97 | 97 | </div> |
98 | - <?php else : echo '<div class="error"><p>' . __( 'Oops, this settings page does not exist.', 'give' ) . '</p></div>'; ?> |
|
98 | + <?php else : echo '<div class="error"><p>'.__('Oops, this settings page does not exist.', 'give').'</p></div>'; ?> |
|
99 | 99 | <?php endif; ?> |
100 | 100 | \ No newline at end of file |
@@ -95,5 +95,8 @@ |
||
95 | 95 | <?php endif; ?> |
96 | 96 | <?php echo $form_close_tag; ?> |
97 | 97 | </div> |
98 | - <?php else : echo '<div class="error"><p>' . __( 'Oops, this settings page does not exist.', 'give' ) . '</p></div>'; ?> |
|
98 | + <?php else { |
|
99 | + : echo '<div class="error"><p>' . __( 'Oops, this settings page does not exist.', 'give' ) . '</p></div>'; |
|
100 | +} |
|
101 | +?> |
|
99 | 102 | <?php endif; ?> |
100 | 103 | \ No newline at end of file |