@@ -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 | |
@@ -78,15 +78,15 @@ discard block |
||
| 78 | 78 | * |
| 79 | 79 | * @since 1.0 |
| 80 | 80 | */ |
| 81 | - public function __construct( $_data ) { |
|
| 81 | + public function __construct($_data) { |
|
| 82 | 82 | |
| 83 | 83 | $this->data = $_data; |
| 84 | 84 | |
| 85 | 85 | // Generate unique ID |
| 86 | - $this->id = md5( rand() ); |
|
| 86 | + $this->id = md5(rand()); |
|
| 87 | 87 | |
| 88 | 88 | // Setup default options; |
| 89 | - $this->options = apply_filters( 'give_graph_args', array( |
|
| 89 | + $this->options = apply_filters('give_graph_args', array( |
|
| 90 | 90 | 'y_mode' => null, |
| 91 | 91 | 'x_mode' => null, |
| 92 | 92 | 'y_decimals' => 0, |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | 'bars' => true, |
| 104 | 104 | 'lines' => false, |
| 105 | 105 | 'points' => true |
| 106 | - ) ); |
|
| 106 | + )); |
|
| 107 | 107 | |
| 108 | 108 | } |
| 109 | 109 | |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | * |
| 116 | 116 | * @since 1.0 |
| 117 | 117 | */ |
| 118 | - public function set( $key, $value ) { |
|
| 119 | - $this->options[ $key ] = $value; |
|
| 118 | + public function set($key, $value) { |
|
| 119 | + $this->options[$key] = $value; |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -126,8 +126,8 @@ discard block |
||
| 126 | 126 | * |
| 127 | 127 | * @since 1.0 |
| 128 | 128 | */ |
| 129 | - public function get( $key ) { |
|
| 130 | - return isset( $this->options[ $key ] ) ? $this->options[ $key ] : false; |
|
| 129 | + public function get($key) { |
|
| 130 | + return isset($this->options[$key]) ? $this->options[$key] : false; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /** |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | * @since 1.0 |
| 137 | 137 | */ |
| 138 | 138 | public function get_data() { |
| 139 | - return apply_filters( 'give_get_graph_data', $this->data, $this ); |
|
| 139 | + return apply_filters('give_get_graph_data', $this->data, $this); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |
@@ -146,19 +146,19 @@ discard block |
||
| 146 | 146 | */ |
| 147 | 147 | public function load_scripts() { |
| 148 | 148 | // Use minified libraries if SCRIPT_DEBUG is turned off |
| 149 | - $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
|
| 149 | + $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
| 150 | 150 | |
| 151 | - wp_register_script( 'jquery-flot-orderbars', GIVE_PLUGIN_URL . 'assets/js/plugins/jquery.flot.orderBars' . $suffix . '.js', array('jquery-flot'), GIVE_VERSION ); |
|
| 152 | - wp_enqueue_script( 'jquery-flot-orderbars' ); |
|
| 151 | + wp_register_script('jquery-flot-orderbars', GIVE_PLUGIN_URL.'assets/js/plugins/jquery.flot.orderBars'.$suffix.'.js', array('jquery-flot'), GIVE_VERSION); |
|
| 152 | + wp_enqueue_script('jquery-flot-orderbars'); |
|
| 153 | 153 | |
| 154 | - wp_register_script( 'jquery-flot-time', GIVE_PLUGIN_URL . 'assets/js/plugins/jquery.flot.time' . $suffix . '.js', array('jquery-flot'), GIVE_VERSION ); |
|
| 155 | - wp_enqueue_script( 'jquery-flot-time' ); |
|
| 154 | + wp_register_script('jquery-flot-time', GIVE_PLUGIN_URL.'assets/js/plugins/jquery.flot.time'.$suffix.'.js', array('jquery-flot'), GIVE_VERSION); |
|
| 155 | + wp_enqueue_script('jquery-flot-time'); |
|
| 156 | 156 | |
| 157 | - wp_register_script( 'jquery-flot-resize', GIVE_PLUGIN_URL . 'assets/js/plugins/jquery.flot.resize' . $suffix . '.js', array('jquery-flot'), GIVE_VERSION ); |
|
| 158 | - wp_enqueue_script( 'jquery-flot-resize' ); |
|
| 157 | + wp_register_script('jquery-flot-resize', GIVE_PLUGIN_URL.'assets/js/plugins/jquery.flot.resize'.$suffix.'.js', array('jquery-flot'), GIVE_VERSION); |
|
| 158 | + wp_enqueue_script('jquery-flot-resize'); |
|
| 159 | 159 | |
| 160 | - wp_register_script( 'jquery-flot', GIVE_PLUGIN_URL . 'assets/js/plugins/jquery.flot' . $suffix . '.js', false, GIVE_VERSION ); |
|
| 161 | - wp_enqueue_script( 'jquery-flot' ); |
|
| 160 | + wp_register_script('jquery-flot', GIVE_PLUGIN_URL.'assets/js/plugins/jquery.flot'.$suffix.'.js', false, GIVE_VERSION); |
|
| 161 | + wp_enqueue_script('jquery-flot'); |
|
| 162 | 162 | |
| 163 | 163 | } |
| 164 | 164 | |
@@ -185,13 +185,13 @@ discard block |
||
| 185 | 185 | [ |
| 186 | 186 | <?php |
| 187 | 187 | $order = 0; |
| 188 | - foreach( $this->get_data() as $label => $data ) : |
|
| 188 | + foreach ($this->get_data() as $label => $data) : |
|
| 189 | 189 | ?> |
| 190 | 190 | { |
| 191 | - label : "<?php echo esc_attr( $label ); ?>", |
|
| 192 | - id : "<?php echo sanitize_key( $label ); ?>", |
|
| 191 | + label : "<?php echo esc_attr($label); ?>", |
|
| 192 | + id : "<?php echo sanitize_key($label); ?>", |
|
| 193 | 193 | // data format is: [ point on x, value on y ] |
| 194 | - data : [<?php foreach( $data as $point ) { echo '[' . implode( ',', $point ) . '],'; } ?>], |
|
| 194 | + data : [<?php foreach ($data as $point) { echo '['.implode(',', $point).'],'; } ?>], |
|
| 195 | 195 | points: { |
| 196 | 196 | show: <?php echo $this->options['points'] ? 'true' : 'false'; ?>, |
| 197 | 197 | }, |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | fill : true, |
| 207 | 207 | fillColor: {colors: [{opacity: 0.4}, {opacity: 0.1}]} |
| 208 | 208 | }, |
| 209 | - <?php if( $this->options[ 'multiple_y_axes' ] ) : ?> |
|
| 209 | + <?php if ($this->options['multiple_y_axes']) : ?> |
|
| 210 | 210 | yaxis : <?php echo $yaxis_count; ?> |
| 211 | 211 | <?php endif; ?> |
| 212 | 212 | |
@@ -220,10 +220,10 @@ discard block |
||
| 220 | 220 | grid: { |
| 221 | 221 | show : true, |
| 222 | 222 | aboveData : false, |
| 223 | - color : "<?php echo $this->options[ 'color' ]; ?>", |
|
| 224 | - backgroundColor: "<?php echo $this->options[ 'bgcolor' ]; ?>", |
|
| 225 | - borderColor : "<?php echo $this->options[ 'bordercolor' ]; ?>", |
|
| 226 | - borderWidth : <?php echo absint( $this->options[ 'borderwidth' ] ); ?>, |
|
| 223 | + color : "<?php echo $this->options['color']; ?>", |
|
| 224 | + backgroundColor: "<?php echo $this->options['bgcolor']; ?>", |
|
| 225 | + borderColor : "<?php echo $this->options['bordercolor']; ?>", |
|
| 226 | + borderWidth : <?php echo absint($this->options['borderwidth']); ?>, |
|
| 227 | 227 | clickable : false, |
| 228 | 228 | hoverable : true |
| 229 | 229 | }, |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | mode : "<?php echo $this->options['x_mode']; ?>", |
| 235 | 235 | timeFormat : "<?php echo $this->options['x_mode'] == 'time' ? $this->options['time_format'] : ''; ?>", |
| 236 | 236 | tickSize : "<?php echo $this->options['x_mode'] == 'time' ? '' : 1; ?>", |
| 237 | - <?php if( $this->options['x_mode'] != 'time' ) : ?> |
|
| 237 | + <?php if ($this->options['x_mode'] != 'time') : ?> |
|
| 238 | 238 | tickDecimals: <?php echo $this->options['x_decimals']; ?> |
| 239 | 239 | <?php endif; ?> |
| 240 | 240 | }, |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | min : 0, |
| 244 | 244 | mode : "<?php echo $this->options['y_mode']; ?>", |
| 245 | 245 | timeFormat : "<?php echo $this->options['y_mode'] == 'time' ? $this->options['time_format'] : ''; ?>", |
| 246 | - <?php if( $this->options['y_mode'] != 'time' ) : ?> |
|
| 246 | + <?php if ($this->options['y_mode'] != 'time') : ?> |
|
| 247 | 247 | tickDecimals: <?php echo $this->options['y_decimals']; ?> |
| 248 | 248 | <?php endif; ?> |
| 249 | 249 | } |
@@ -303,9 +303,9 @@ discard block |
||
| 303 | 303 | * @since 1.0 |
| 304 | 304 | */ |
| 305 | 305 | public function display() { |
| 306 | - do_action( 'give_before_graph', $this ); |
|
| 306 | + do_action('give_before_graph', $this); |
|
| 307 | 307 | echo $this->build_graph(); |
| 308 | - do_action( 'give_after_graph', $this ); |
|
| 308 | + do_action('give_after_graph', $this); |
|
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | } |
@@ -19,6 +19,6 @@ |
||
| 19 | 19 | * @return void |
| 20 | 20 | */ |
| 21 | 21 | function give_disable_mandrill_nl2br() { |
| 22 | - add_filter( 'mandrill_nl2br', '__return_false' ); |
|
| 22 | + add_filter('mandrill_nl2br', '__return_false'); |
|
| 23 | 23 | } |
| 24 | -add_action( 'give_email_send_before', 'give_disable_mandrill_nl2br'); |
|
| 24 | +add_action('give_email_send_before', 'give_disable_mandrill_nl2br'); |
|
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
@@ -19,10 +19,10 @@ discard block |
||
| 19 | 19 | * @since 1.5 |
| 20 | 20 | */ |
| 21 | 21 | function give_register_batch_recount_store_earnings_tool() { |
| 22 | - add_action( 'give_batch_export_class_include', 'give_include_recount_income_tool_batch_processor', 10, 1 ); |
|
| 22 | + add_action('give_batch_export_class_include', 'give_include_recount_income_tool_batch_processor', 10, 1); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | -add_action( 'give_register_batch_exporter', 'give_register_batch_recount_store_earnings_tool', 10 ); |
|
| 25 | +add_action('give_register_batch_exporter', 'give_register_batch_recount_store_earnings_tool', 10); |
|
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * Loads the tools batch processing class for recounting store earnings |
@@ -33,11 +33,11 @@ discard block |
||
| 33 | 33 | * |
| 34 | 34 | * @return void |
| 35 | 35 | */ |
| 36 | -function give_include_recount_income_tool_batch_processor( $class ) { |
|
| 36 | +function give_include_recount_income_tool_batch_processor($class) { |
|
| 37 | 37 | |
| 38 | - $file_path = GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/class-give-tools-recount-income.php'; |
|
| 38 | + $file_path = GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/class-give-tools-recount-income.php'; |
|
| 39 | 39 | |
| 40 | - if ( 'Give_Tools_Recount_Income' === $class && file_exists( $file_path ) ) { |
|
| 40 | + if ('Give_Tools_Recount_Income' === $class && file_exists($file_path)) { |
|
| 41 | 41 | require_once $file_path; |
| 42 | 42 | } |
| 43 | 43 | |
@@ -49,10 +49,10 @@ discard block |
||
| 49 | 49 | * @since 1.5 |
| 50 | 50 | */ |
| 51 | 51 | function give_register_batch_recount_form_tool() { |
| 52 | - add_action( 'give_batch_export_class_include', 'give_include_recount_form_tool_batch_processor', 10, 1 ); |
|
| 52 | + add_action('give_batch_export_class_include', 'give_include_recount_form_tool_batch_processor', 10, 1); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | -add_action( 'give_register_batch_exporter', 'give_register_batch_recount_form_tool', 10 ); |
|
| 55 | +add_action('give_register_batch_exporter', 'give_register_batch_recount_form_tool', 10); |
|
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * Loads the tools batch processing class for recounting download stats |
@@ -63,11 +63,11 @@ discard block |
||
| 63 | 63 | * |
| 64 | 64 | * @return void |
| 65 | 65 | */ |
| 66 | -function give_include_recount_form_tool_batch_processor( $class ) { |
|
| 66 | +function give_include_recount_form_tool_batch_processor($class) { |
|
| 67 | 67 | |
| 68 | - $file_path = GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/class-give-tools-recount-form-stats.php'; |
|
| 68 | + $file_path = GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/class-give-tools-recount-form-stats.php'; |
|
| 69 | 69 | |
| 70 | - if ( 'Give_Tools_Recount_Form_Stats' === $class && file_exists( $file_path ) ) { |
|
| 70 | + if ('Give_Tools_Recount_Form_Stats' === $class && file_exists($file_path)) { |
|
| 71 | 71 | require_once $file_path; |
| 72 | 72 | } |
| 73 | 73 | |
@@ -78,10 +78,10 @@ discard block |
||
| 78 | 78 | * @since 1.5 |
| 79 | 79 | */ |
| 80 | 80 | function give_register_batch_recount_all_tool() { |
| 81 | - add_action( 'give_batch_export_class_include', 'give_include_recount_all_tool_batch_processor', 10, 1 ); |
|
| 81 | + add_action('give_batch_export_class_include', 'give_include_recount_all_tool_batch_processor', 10, 1); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | -add_action( 'give_register_batch_exporter', 'give_register_batch_recount_all_tool', 10 ); |
|
| 84 | +add_action('give_register_batch_exporter', 'give_register_batch_recount_all_tool', 10); |
|
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | 87 | * Loads the tools batch processing class for recounting all stats |
@@ -92,9 +92,9 @@ discard block |
||
| 92 | 92 | * |
| 93 | 93 | * @return void |
| 94 | 94 | */ |
| 95 | -function give_include_recount_all_tool_batch_processor( $class ) { |
|
| 96 | - $file_path = GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/class-give-tools-recount-all-stats.php'; |
|
| 97 | - if ( 'Give_Tools_Recount_All_Stats' === $class && file_exists( $file_path ) ) { |
|
| 95 | +function give_include_recount_all_tool_batch_processor($class) { |
|
| 96 | + $file_path = GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/class-give-tools-recount-all-stats.php'; |
|
| 97 | + if ('Give_Tools_Recount_All_Stats' === $class && file_exists($file_path)) { |
|
| 98 | 98 | require_once $file_path; |
| 99 | 99 | } |
| 100 | 100 | |
@@ -106,10 +106,10 @@ discard block |
||
| 106 | 106 | * @since 1.5 |
| 107 | 107 | */ |
| 108 | 108 | function give_register_batch_reset_tool() { |
| 109 | - add_action( 'give_batch_export_class_include', 'give_include_reset_tool_batch_processor', 10, 1 ); |
|
| 109 | + add_action('give_batch_export_class_include', 'give_include_reset_tool_batch_processor', 10, 1); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | -add_action( 'give_register_batch_exporter', 'give_register_batch_reset_tool', 10 ); |
|
| 112 | +add_action('give_register_batch_exporter', 'give_register_batch_reset_tool', 10); |
|
| 113 | 113 | |
| 114 | 114 | /** |
| 115 | 115 | * Loads the tools batch processing class for resetting store and product earnings |
@@ -120,11 +120,11 @@ discard block |
||
| 120 | 120 | * |
| 121 | 121 | * @return void |
| 122 | 122 | */ |
| 123 | -function give_include_reset_tool_batch_processor( $class ) { |
|
| 123 | +function give_include_reset_tool_batch_processor($class) { |
|
| 124 | 124 | |
| 125 | - $file_path = GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/class-give-tools-reset-stats.php'; |
|
| 125 | + $file_path = GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/class-give-tools-reset-stats.php'; |
|
| 126 | 126 | |
| 127 | - if ( 'Give_Tools_Reset_Stats' === $class && file_exists( $file_path ) ) { |
|
| 127 | + if ('Give_Tools_Reset_Stats' === $class && file_exists($file_path)) { |
|
| 128 | 128 | require_once $file_path; |
| 129 | 129 | } |
| 130 | 130 | |
@@ -135,10 +135,10 @@ discard block |
||
| 135 | 135 | * @since 1.5 |
| 136 | 136 | */ |
| 137 | 137 | function give_register_batch_customer_recount_tool() { |
| 138 | - add_action( 'give_batch_export_class_include', 'give_include_customer_recount_tool_batch_processor', 10, 1 ); |
|
| 138 | + add_action('give_batch_export_class_include', 'give_include_customer_recount_tool_batch_processor', 10, 1); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | -add_action( 'give_register_batch_exporter', 'give_register_batch_customer_recount_tool', 10 ); |
|
| 141 | +add_action('give_register_batch_exporter', 'give_register_batch_customer_recount_tool', 10); |
|
| 142 | 142 | |
| 143 | 143 | /** |
| 144 | 144 | * Loads the tools batch processing class for resetting all customer stats |
@@ -149,11 +149,11 @@ discard block |
||
| 149 | 149 | * |
| 150 | 150 | * @return void |
| 151 | 151 | */ |
| 152 | -function give_include_customer_recount_tool_batch_processor( $class ) { |
|
| 152 | +function give_include_customer_recount_tool_batch_processor($class) { |
|
| 153 | 153 | |
| 154 | - $file_path = GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/class-give-tools-recount-customer-stats.php'; |
|
| 154 | + $file_path = GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/class-give-tools-recount-customer-stats.php'; |
|
| 155 | 155 | |
| 156 | - if ( 'Give_Tools_Recount_Customer_Stats' === $class && file_exists( $file_path ) ) { |
|
| 156 | + if ('Give_Tools_Recount_Customer_Stats' === $class && file_exists($file_path)) { |
|
| 157 | 157 | require_once $file_path; |
| 158 | 158 | } |
| 159 | 159 | |
@@ -164,10 +164,10 @@ discard block |
||
| 164 | 164 | * @since 1.5 |
| 165 | 165 | */ |
| 166 | 166 | function give_register_batch_delete_test_transactions_tool() { |
| 167 | - add_action( 'give_batch_export_class_include', 'give_include_delete_test_transactions_batch_processor', 10, 1 ); |
|
| 167 | + add_action('give_batch_export_class_include', 'give_include_delete_test_transactions_batch_processor', 10, 1); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | -add_action( 'give_register_batch_exporter', 'give_register_batch_delete_test_transactions_tool', 10 ); |
|
| 170 | +add_action('give_register_batch_exporter', 'give_register_batch_delete_test_transactions_tool', 10); |
|
| 171 | 171 | |
| 172 | 172 | /** |
| 173 | 173 | * Loads the tools batch processing class for resetting all customer stats |
@@ -178,11 +178,11 @@ discard block |
||
| 178 | 178 | * |
| 179 | 179 | * @return void |
| 180 | 180 | */ |
| 181 | -function give_include_delete_test_transactions_batch_processor( $class ) { |
|
| 181 | +function give_include_delete_test_transactions_batch_processor($class) { |
|
| 182 | 182 | |
| 183 | - $file_path = GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/class-give-tools-delete-test-transactions.php'; |
|
| 183 | + $file_path = GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/class-give-tools-delete-test-transactions.php'; |
|
| 184 | 184 | |
| 185 | - if ( 'Give_Tools_Delete_Test_Transactions' === $class && file_exists( $file_path ) ) { |
|
| 185 | + if ('Give_Tools_Delete_Test_Transactions' === $class && file_exists($file_path)) { |
|
| 186 | 186 | require_once $file_path; |
| 187 | 187 | } |
| 188 | 188 | |
@@ -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 | |
@@ -23,13 +23,13 @@ discard block |
||
| 23 | 23 | * |
| 24 | 24 | * @return bool true if has variable prices, false otherwise |
| 25 | 25 | */ |
| 26 | -function give_has_variable_prices( $form_id = 0 ) { |
|
| 26 | +function give_has_variable_prices($form_id = 0) { |
|
| 27 | 27 | |
| 28 | - if ( empty( $form_id ) ) { |
|
| 28 | + if (empty($form_id)) { |
|
| 29 | 29 | return false; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - $form = new Give_Donate_Form( $form_id ); |
|
| 32 | + $form = new Give_Donate_Form($form_id); |
|
| 33 | 33 | |
| 34 | 34 | return $form->has_variable_prices(); |
| 35 | 35 | } |
@@ -44,13 +44,13 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * @return array Variable prices |
| 46 | 46 | */ |
| 47 | -function give_get_variable_prices( $form_id = 0 ) { |
|
| 47 | +function give_get_variable_prices($form_id = 0) { |
|
| 48 | 48 | |
| 49 | - if ( empty( $form_id ) ) { |
|
| 49 | + if (empty($form_id)) { |
|
| 50 | 50 | return false; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - $form = new Give_Donate_Form( $form_id ); |
|
| 53 | + $form = new Give_Donate_Form($form_id); |
|
| 54 | 54 | |
| 55 | 55 | return $form->prices; |
| 56 | 56 | |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | * |
| 68 | 68 | * @return string $default_price |
| 69 | 69 | */ |
| 70 | -function give_get_default_multilevel_amount( $form_id ) { |
|
| 70 | +function give_get_default_multilevel_amount($form_id) { |
|
| 71 | 71 | $default_price = '1.00'; |
| 72 | - $prices = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $form_id ), $form_id ); |
|
| 72 | + $prices = apply_filters('give_form_variable_prices', give_get_variable_prices($form_id), $form_id); |
|
| 73 | 73 | |
| 74 | - foreach ( $prices as $price ) { |
|
| 74 | + foreach ($prices as $price) { |
|
| 75 | 75 | |
| 76 | - if ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) { |
|
| 76 | + if (isset($price['_give_default']) && $price['_give_default'] === 'default') { |
|
| 77 | 77 | $default_price = $price['_give_amount']; |
| 78 | 78 | } |
| 79 | 79 | |
@@ -94,15 +94,15 @@ discard block |
||
| 94 | 94 | * @return string $default_price |
| 95 | 95 | * @since 1.0 |
| 96 | 96 | */ |
| 97 | -function give_get_default_form_amount( $form_id ) { |
|
| 97 | +function give_get_default_form_amount($form_id) { |
|
| 98 | 98 | |
| 99 | - if ( give_has_variable_prices( $form_id ) ) { |
|
| 99 | + if (give_has_variable_prices($form_id)) { |
|
| 100 | 100 | |
| 101 | - $default_amount = give_get_default_multilevel_amount( $form_id ); |
|
| 101 | + $default_amount = give_get_default_multilevel_amount($form_id); |
|
| 102 | 102 | |
| 103 | 103 | } else { |
| 104 | 104 | |
| 105 | - $default_amount = get_post_meta( $form_id, '_give_set_price', true ); |
|
| 105 | + $default_amount = get_post_meta($form_id, '_give_set_price', true); |
|
| 106 | 106 | |
| 107 | 107 | } |
| 108 | 108 | |
@@ -123,13 +123,13 @@ discard block |
||
| 123 | 123 | * |
| 124 | 124 | * @return bool |
| 125 | 125 | */ |
| 126 | -function give_is_custom_price_mode( $form_id = 0 ) { |
|
| 126 | +function give_is_custom_price_mode($form_id = 0) { |
|
| 127 | 127 | |
| 128 | - if ( empty( $form_id ) ) { |
|
| 128 | + if (empty($form_id)) { |
|
| 129 | 129 | return false; |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - $form = new Give_Donate_Form( $form_id ); |
|
| 132 | + $form = new Give_Donate_Form($form_id); |
|
| 133 | 133 | |
| 134 | 134 | return $form->is_custom_price_mode(); |
| 135 | 135 | } |
| 136 | 136 | \ No newline at end of file |
@@ -11,12 +11,12 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | // Exit if accessed directly |
| 14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 14 | +if ( ! defined('ABSPATH')) { |
|
| 15 | 15 | exit; |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | -require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-export.php'; |
|
| 19 | -require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/export-actions.php'; |
|
| 18 | +require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-export.php'; |
|
| 19 | +require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/export-actions.php'; |
|
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * Process batch exports via ajax |
@@ -26,79 +26,79 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | function give_do_ajax_export() { |
| 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 | - parse_str( $_POST['form'], $form ); |
|
| 31 | + parse_str($_POST['form'], $form); |
|
| 32 | 32 | |
| 33 | 33 | $_REQUEST = $form = (array) $form; |
| 34 | 34 | |
| 35 | - if ( ! wp_verify_nonce( $_REQUEST['give_ajax_export'], 'give_ajax_export' ) ) { |
|
| 36 | - die( '-2' ); |
|
| 35 | + if ( ! wp_verify_nonce($_REQUEST['give_ajax_export'], 'give_ajax_export')) { |
|
| 36 | + die('-2'); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - do_action( 'give_batch_export_class_include', $form['give-export-class'] ); |
|
| 39 | + do_action('give_batch_export_class_include', $form['give-export-class']); |
|
| 40 | 40 | |
| 41 | - $step = absint( $_POST['step'] ); |
|
| 42 | - $class = sanitize_text_field( $form['give-export-class'] ); |
|
| 41 | + $step = absint($_POST['step']); |
|
| 42 | + $class = sanitize_text_field($form['give-export-class']); |
|
| 43 | 43 | |
| 44 | - $export = new $class( $step ); |
|
| 44 | + $export = new $class($step); |
|
| 45 | 45 | |
| 46 | - if ( ! $export->can_export() ) { |
|
| 47 | - die( '-1' ); |
|
| 46 | + if ( ! $export->can_export()) { |
|
| 47 | + die('-1'); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if ( ! $export->is_writable ) { |
|
| 50 | + if ( ! $export->is_writable) { |
|
| 51 | 51 | $json_args = array( |
| 52 | 52 | 'error' => true, |
| 53 | - 'message' => esc_html__( 'Export location or file not writable.', 'give' ) |
|
| 53 | + 'message' => esc_html__('Export location or file not writable.', 'give') |
|
| 54 | 54 | ); |
| 55 | 55 | echo json_encode($json_args); |
| 56 | 56 | exit; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - $export->set_properties( $_REQUEST ); |
|
| 59 | + $export->set_properties($_REQUEST); |
|
| 60 | 60 | |
| 61 | 61 | $export->pre_fetch(); |
| 62 | 62 | |
| 63 | - $ret = $export->process_step( $step ); |
|
| 63 | + $ret = $export->process_step($step); |
|
| 64 | 64 | |
| 65 | 65 | $percentage = $export->get_percentage_complete(); |
| 66 | 66 | |
| 67 | - if ( $ret ) { |
|
| 67 | + if ($ret) { |
|
| 68 | 68 | |
| 69 | 69 | $step += 1; |
| 70 | - echo json_encode( array( 'step' => $step, 'percentage' => $percentage ) ); |
|
| 70 | + echo json_encode(array('step' => $step, 'percentage' => $percentage)); |
|
| 71 | 71 | exit; |
| 72 | 72 | |
| 73 | - } elseif ( true === $export->is_empty ) { |
|
| 73 | + } elseif (true === $export->is_empty) { |
|
| 74 | 74 | |
| 75 | - echo json_encode( array( |
|
| 75 | + echo json_encode(array( |
|
| 76 | 76 | 'error' => true, |
| 77 | - 'message' => esc_html__( 'No data found for export parameters.', 'give' ) |
|
| 78 | - ) ); |
|
| 77 | + 'message' => esc_html__('No data found for export parameters.', 'give') |
|
| 78 | + )); |
|
| 79 | 79 | exit; |
| 80 | 80 | |
| 81 | - } elseif ( true === $export->done && true === $export->is_void ) { |
|
| 81 | + } elseif (true === $export->done && true === $export->is_void) { |
|
| 82 | 82 | |
| 83 | - $message = ! empty( $export->message ) ? $export->message : esc_html__( 'Batch Processing Complete', 'give' ); |
|
| 84 | - echo json_encode( array( 'success' => true, 'message' => $message ) ); |
|
| 83 | + $message = ! empty($export->message) ? $export->message : esc_html__('Batch Processing Complete', 'give'); |
|
| 84 | + echo json_encode(array('success' => true, 'message' => $message)); |
|
| 85 | 85 | exit; |
| 86 | 86 | |
| 87 | 87 | } else { |
| 88 | 88 | |
| 89 | - $args = array_merge( $_REQUEST, array( |
|
| 89 | + $args = array_merge($_REQUEST, array( |
|
| 90 | 90 | 'step' => $step, |
| 91 | 91 | 'class' => $class, |
| 92 | - 'nonce' => wp_create_nonce( 'give-batch-export' ), |
|
| 92 | + 'nonce' => wp_create_nonce('give-batch-export'), |
|
| 93 | 93 | 'give_action' => 'form_batch_export', |
| 94 | - ) ); |
|
| 94 | + )); |
|
| 95 | 95 | |
| 96 | - $download_url = add_query_arg( $args, admin_url() ); |
|
| 96 | + $download_url = add_query_arg($args, admin_url()); |
|
| 97 | 97 | |
| 98 | - echo json_encode( array( 'step' => 'done', 'url' => $download_url ) ); |
|
| 98 | + echo json_encode(array('step' => 'done', 'url' => $download_url)); |
|
| 99 | 99 | exit; |
| 100 | 100 | |
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | -add_action( 'wp_ajax_give_do_ajax_export', 'give_do_ajax_export' ); |
|
| 104 | +add_action('wp_ajax_give_do_ajax_export', 'give_do_ajax_export'); |
|
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | // Exit if accessed directly |
| 14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 14 | +if ( ! defined('ABSPATH')) { |
|
| 15 | 15 | exit; |
| 16 | 16 | } |
| 17 | 17 | |
@@ -55,22 +55,22 @@ discard block |
||
| 55 | 55 | public function get_data() { |
| 56 | 56 | global $wpdb; |
| 57 | 57 | |
| 58 | - $items = $this->get_stored_data( 'give_temp_reset_ids' ); |
|
| 58 | + $items = $this->get_stored_data('give_temp_reset_ids'); |
|
| 59 | 59 | |
| 60 | - if ( ! is_array( $items ) ) { |
|
| 60 | + if ( ! is_array($items)) { |
|
| 61 | 61 | return false; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - $offset = ( $this->step - 1 ) * $this->per_step; |
|
| 65 | - $step_items = array_slice( $items, $offset, $this->per_step ); |
|
| 64 | + $offset = ($this->step - 1) * $this->per_step; |
|
| 65 | + $step_items = array_slice($items, $offset, $this->per_step); |
|
| 66 | 66 | |
| 67 | - if ( $step_items ) { |
|
| 67 | + if ($step_items) { |
|
| 68 | 68 | |
| 69 | 69 | $step_ids = array( |
| 70 | 70 | 'other' => array(), |
| 71 | 71 | ); |
| 72 | 72 | |
| 73 | - foreach ( $step_items as $item ) { |
|
| 73 | + foreach ($step_items as $item) { |
|
| 74 | 74 | |
| 75 | 75 | $step_ids['other'][] = $item['id']; |
| 76 | 76 | |
@@ -78,15 +78,15 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | $sql = array(); |
| 80 | 80 | |
| 81 | - foreach ( $step_ids as $type => $ids ) { |
|
| 81 | + foreach ($step_ids as $type => $ids) { |
|
| 82 | 82 | |
| 83 | - if ( empty( $ids ) ) { |
|
| 83 | + if (empty($ids)) { |
|
| 84 | 84 | continue; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - $ids = implode( ',', $ids ); |
|
| 87 | + $ids = implode(',', $ids); |
|
| 88 | 88 | |
| 89 | - switch ( $type ) { |
|
| 89 | + switch ($type) { |
|
| 90 | 90 | case 'other': |
| 91 | 91 | $sql[] = "DELETE FROM $wpdb->posts WHERE id IN ($ids)"; |
| 92 | 92 | $sql[] = "DELETE FROM $wpdb->postmeta WHERE post_id IN ($ids)"; |
@@ -97,9 +97,9 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - if ( ! empty( $sql ) ) { |
|
| 101 | - foreach ( $sql as $query ) { |
|
| 102 | - $wpdb->query( $query ); |
|
| 100 | + if ( ! empty($sql)) { |
|
| 101 | + foreach ($sql as $query) { |
|
| 102 | + $wpdb->query($query); |
|
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |
@@ -119,16 +119,16 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | public function get_percentage_complete() { |
| 121 | 121 | |
| 122 | - $items = $this->get_stored_data( 'give_temp_reset_ids', false ); |
|
| 123 | - $total = count( $items ); |
|
| 122 | + $items = $this->get_stored_data('give_temp_reset_ids', false); |
|
| 123 | + $total = count($items); |
|
| 124 | 124 | |
| 125 | 125 | $percentage = 100; |
| 126 | 126 | |
| 127 | - if ( $total > 0 ) { |
|
| 128 | - $percentage = ( ( $this->per_step * $this->step ) / $total ) * 100; |
|
| 127 | + if ($total > 0) { |
|
| 128 | + $percentage = (($this->per_step * $this->step) / $total) * 100; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - if ( $percentage > 100 ) { |
|
| 131 | + if ($percentage > 100) { |
|
| 132 | 132 | $percentage = 100; |
| 133 | 133 | } |
| 134 | 134 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | * |
| 143 | 143 | * @param array $request The Form Data passed into the batch processing |
| 144 | 144 | */ |
| 145 | - public function set_properties( $request ) { |
|
| 145 | + public function set_properties($request) { |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | /** |
@@ -153,30 +153,30 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | public function process_step() { |
| 155 | 155 | |
| 156 | - if ( ! $this->can_export() ) { |
|
| 157 | - wp_die( esc_html__( 'You do not have permission to delete test transactions.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
| 156 | + if ( ! $this->can_export()) { |
|
| 157 | + wp_die(esc_html__('You do not have permission to delete test transactions.', 'give'), esc_html__('Error', 'give'), array('response' => 403)); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | $had_data = $this->get_data(); |
| 161 | 161 | |
| 162 | - if ( $had_data ) { |
|
| 162 | + if ($had_data) { |
|
| 163 | 163 | $this->done = false; |
| 164 | 164 | |
| 165 | 165 | return true; |
| 166 | 166 | } else { |
| 167 | - update_option( 'give_earnings_total', 0 ); |
|
| 168 | - delete_transient( 'give_earnings_total' ); |
|
| 169 | - delete_transient( 'give_estimated_monthly_stats' . true ); |
|
| 170 | - delete_transient( 'give_estimated_monthly_stats' . false ); |
|
| 171 | - $this->delete_data( 'give_temp_reset_ids' ); |
|
| 167 | + update_option('give_earnings_total', 0); |
|
| 168 | + delete_transient('give_earnings_total'); |
|
| 169 | + delete_transient('give_estimated_monthly_stats'.true); |
|
| 170 | + delete_transient('give_estimated_monthly_stats'.false); |
|
| 171 | + $this->delete_data('give_temp_reset_ids'); |
|
| 172 | 172 | |
| 173 | 173 | // Reset the sequential order numbers |
| 174 | - if ( give_get_option( 'enable_sequential' ) ) { |
|
| 175 | - delete_option( 'give_last_payment_number' ); |
|
| 174 | + if (give_get_option('enable_sequential')) { |
|
| 175 | + delete_option('give_last_payment_number'); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | $this->done = true; |
| 179 | - $this->message = esc_html__( 'Test transactions successfully deleted.', 'give' ); |
|
| 179 | + $this->message = esc_html__('Test transactions successfully deleted.', 'give'); |
|
| 180 | 180 | |
| 181 | 181 | return false; |
| 182 | 182 | } |
@@ -186,10 +186,10 @@ discard block |
||
| 186 | 186 | * Headers |
| 187 | 187 | */ |
| 188 | 188 | public function headers() { |
| 189 | - ignore_user_abort( true ); |
|
| 189 | + ignore_user_abort(true); |
|
| 190 | 190 | |
| 191 | - if ( ! give_is_func_disabled( 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) { |
|
| 192 | - set_time_limit( 0 ); |
|
| 191 | + if ( ! give_is_func_disabled('set_time_limit') && ! ini_get('safe_mode')) { |
|
| 192 | + set_time_limit(0); |
|
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | 195 | |
@@ -213,26 +213,26 @@ discard block |
||
| 213 | 213 | */ |
| 214 | 214 | public function pre_fetch() { |
| 215 | 215 | |
| 216 | - if ( $this->step == 1 ) { |
|
| 217 | - $this->delete_data( 'give_temp_reset_ids' ); |
|
| 216 | + if ($this->step == 1) { |
|
| 217 | + $this->delete_data('give_temp_reset_ids'); |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | - $items = get_option( 'give_temp_reset_ids', false ); |
|
| 220 | + $items = get_option('give_temp_reset_ids', false); |
|
| 221 | 221 | |
| 222 | - if ( false === $items ) { |
|
| 222 | + if (false === $items) { |
|
| 223 | 223 | $items = array(); |
| 224 | 224 | |
| 225 | - $args = apply_filters( 'give_tools_reset_stats_total_args', array( |
|
| 225 | + $args = apply_filters('give_tools_reset_stats_total_args', array( |
|
| 226 | 226 | 'post_type' => 'give_payment', |
| 227 | 227 | 'post_status' => 'any', |
| 228 | - 'posts_per_page' => - 1, |
|
| 228 | + 'posts_per_page' => -1, |
|
| 229 | 229 | //ONLY TEST MODE TRANSACTIONS!!! |
| 230 | 230 | 'meta_key' => '_give_payment_mode', |
| 231 | 231 | 'meta_value' => 'test' |
| 232 | - ) ); |
|
| 232 | + )); |
|
| 233 | 233 | |
| 234 | - $posts = get_posts( $args ); |
|
| 235 | - foreach ( $posts as $post ) { |
|
| 234 | + $posts = get_posts($args); |
|
| 235 | + foreach ($posts as $post) { |
|
| 236 | 236 | $items[] = array( |
| 237 | 237 | 'id' => (int) $post->ID, |
| 238 | 238 | 'type' => $post->post_type, |
@@ -241,9 +241,9 @@ discard block |
||
| 241 | 241 | |
| 242 | 242 | // Allow filtering of items to remove with an unassociative array for each item |
| 243 | 243 | // The array contains the unique ID of the item, and a 'type' for you to use in the execution of the get_data method |
| 244 | - $items = apply_filters( 'give_reset_store_items', $items ); |
|
| 244 | + $items = apply_filters('give_reset_store_items', $items); |
|
| 245 | 245 | |
| 246 | - $this->store_data( 'give_temp_reset_ids', $items ); |
|
| 246 | + $this->store_data('give_temp_reset_ids', $items); |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | } |
@@ -257,11 +257,11 @@ discard block |
||
| 257 | 257 | * |
| 258 | 258 | * @return mixed Returns the data from the database |
| 259 | 259 | */ |
| 260 | - private function get_stored_data( $key ) { |
|
| 260 | + private function get_stored_data($key) { |
|
| 261 | 261 | global $wpdb; |
| 262 | - $value = $wpdb->get_var( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = '%s'", $key ) ); |
|
| 262 | + $value = $wpdb->get_var($wpdb->prepare("SELECT option_value FROM $wpdb->options WHERE option_name = '%s'", $key)); |
|
| 263 | 263 | |
| 264 | - return empty( $value ) ? false : maybe_unserialize( $value ); |
|
| 264 | + return empty($value) ? false : maybe_unserialize($value); |
|
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | /** |
@@ -274,10 +274,10 @@ discard block |
||
| 274 | 274 | * |
| 275 | 275 | * @return void |
| 276 | 276 | */ |
| 277 | - private function store_data( $key, $value ) { |
|
| 277 | + private function store_data($key, $value) { |
|
| 278 | 278 | global $wpdb; |
| 279 | 279 | |
| 280 | - $value = maybe_serialize( $value ); |
|
| 280 | + $value = maybe_serialize($value); |
|
| 281 | 281 | |
| 282 | 282 | $data = array( |
| 283 | 283 | 'option_name' => $key, |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | '%s', |
| 292 | 292 | ); |
| 293 | 293 | |
| 294 | - $wpdb->replace( $wpdb->options, $data, $formats ); |
|
| 294 | + $wpdb->replace($wpdb->options, $data, $formats); |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | /** |
@@ -303,9 +303,9 @@ discard block |
||
| 303 | 303 | * |
| 304 | 304 | * @return void |
| 305 | 305 | */ |
| 306 | - private function delete_data( $key ) { |
|
| 306 | + private function delete_data($key) { |
|
| 307 | 307 | global $wpdb; |
| 308 | - $wpdb->delete( $wpdb->options, array( 'option_name' => $key ) ); |
|
| 308 | + $wpdb->delete($wpdb->options, array('option_name' => $key)); |
|
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | } |
@@ -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 | |
@@ -29,31 +29,31 @@ discard block |
||
| 29 | 29 | global $give_settings_page, $give_payments_page, $give_reports_page, $give_add_ons_page, $give_upgrades_screen, $give_donors_page; |
| 30 | 30 | |
| 31 | 31 | //Payments |
| 32 | - $give_payment = get_post_type_object( 'give_payment' ); |
|
| 33 | - $give_payments_page = add_submenu_page( 'edit.php?post_type=give_forms', $give_payment->labels->name, $give_payment->labels->menu_name, 'edit_give_payments', 'give-payment-history', 'give_payment_history_page' ); |
|
| 32 | + $give_payment = get_post_type_object('give_payment'); |
|
| 33 | + $give_payments_page = add_submenu_page('edit.php?post_type=give_forms', $give_payment->labels->name, $give_payment->labels->menu_name, 'edit_give_payments', 'give-payment-history', 'give_payment_history_page'); |
|
| 34 | 34 | |
| 35 | 35 | //Donors |
| 36 | - $give_donors_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Donors', 'give' ), esc_html__( 'Donors', 'give' ), 'view_give_reports', 'give-donors', 'give_customers_page' ); |
|
| 36 | + $give_donors_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Donors', 'give'), esc_html__('Donors', 'give'), 'view_give_reports', 'give-donors', 'give_customers_page'); |
|
| 37 | 37 | |
| 38 | 38 | //Reports` |
| 39 | - $give_reports_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Donation Reports', 'give' ), esc_html__( 'Reports', 'give' ), 'view_give_reports', 'give-reports', 'give_reports_page' ); |
|
| 39 | + $give_reports_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Donation Reports', 'give'), esc_html__('Reports', 'give'), 'view_give_reports', 'give-reports', 'give_reports_page'); |
|
| 40 | 40 | |
| 41 | 41 | //Settings |
| 42 | - $give_settings_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Give Settings', 'give' ), esc_html__( 'Settings', 'give' ), 'manage_give_settings', 'give-settings', array( |
|
| 42 | + $give_settings_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Give Settings', 'give'), esc_html__('Settings', 'give'), 'manage_give_settings', 'give-settings', array( |
|
| 43 | 43 | Give()->give_settings, |
| 44 | 44 | 'admin_page_display' |
| 45 | - ) ); |
|
| 45 | + )); |
|
| 46 | 46 | |
| 47 | 47 | //Add-ons |
| 48 | - $give_add_ons_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Give Add-ons', 'give' ), esc_html__( 'Add-ons', 'give' ), 'install_plugins', 'give-addons', 'give_add_ons_page' ); |
|
| 48 | + $give_add_ons_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Give Add-ons', 'give'), esc_html__('Add-ons', 'give'), 'install_plugins', 'give-addons', 'give_add_ons_page'); |
|
| 49 | 49 | |
| 50 | 50 | //Upgrades |
| 51 | - $give_upgrades_screen = add_submenu_page( null, esc_html__( 'Give Upgrades', 'give' ), esc_html__( 'Give Upgrades', 'give' ), 'manage_give_settings', 'give-upgrades', 'give_upgrades_screen' ); |
|
| 51 | + $give_upgrades_screen = add_submenu_page(null, esc_html__('Give Upgrades', 'give'), esc_html__('Give Upgrades', 'give'), 'manage_give_settings', 'give-upgrades', 'give_upgrades_screen'); |
|
| 52 | 52 | |
| 53 | 53 | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | -add_action( 'admin_menu', 'give_add_options_links', 10 ); |
|
| 56 | +add_action('admin_menu', 'give_add_options_links', 10); |
|
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | 59 | * Determines whether the current admin page is a Give admin page. |
@@ -68,224 +68,224 @@ discard block |
||
| 68 | 68 | * |
| 69 | 69 | * @return bool True if Give admin page. |
| 70 | 70 | */ |
| 71 | -function give_is_admin_page( $passed_page = '', $passed_view = '' ) { |
|
| 71 | +function give_is_admin_page($passed_page = '', $passed_view = '') { |
|
| 72 | 72 | |
| 73 | 73 | global $pagenow, $typenow; |
| 74 | 74 | |
| 75 | 75 | $found = false; |
| 76 | - $post_type = isset( $_GET['post_type'] ) ? strtolower( $_GET['post_type'] ) : false; |
|
| 77 | - $action = isset( $_GET['action'] ) ? strtolower( $_GET['action'] ) : false; |
|
| 78 | - $taxonomy = isset( $_GET['taxonomy'] ) ? strtolower( $_GET['taxonomy'] ) : false; |
|
| 79 | - $page = isset( $_GET['page'] ) ? strtolower( $_GET['page'] ) : false; |
|
| 80 | - $view = isset( $_GET['view'] ) ? strtolower( $_GET['view'] ) : false; |
|
| 81 | - $tab = isset( $_GET['tab'] ) ? strtolower( $_GET['tab'] ) : false; |
|
| 76 | + $post_type = isset($_GET['post_type']) ? strtolower($_GET['post_type']) : false; |
|
| 77 | + $action = isset($_GET['action']) ? strtolower($_GET['action']) : false; |
|
| 78 | + $taxonomy = isset($_GET['taxonomy']) ? strtolower($_GET['taxonomy']) : false; |
|
| 79 | + $page = isset($_GET['page']) ? strtolower($_GET['page']) : false; |
|
| 80 | + $view = isset($_GET['view']) ? strtolower($_GET['view']) : false; |
|
| 81 | + $tab = isset($_GET['tab']) ? strtolower($_GET['tab']) : false; |
|
| 82 | 82 | |
| 83 | - switch ( $passed_page ) { |
|
| 83 | + switch ($passed_page) { |
|
| 84 | 84 | case 'give_forms': |
| 85 | - switch ( $passed_view ) { |
|
| 85 | + switch ($passed_view) { |
|
| 86 | 86 | case 'list-table': |
| 87 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' ) { |
|
| 87 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php') { |
|
| 88 | 88 | $found = true; |
| 89 | 89 | } |
| 90 | 90 | break; |
| 91 | 91 | case 'edit': |
| 92 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'post.php' ) { |
|
| 92 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'post.php') { |
|
| 93 | 93 | $found = true; |
| 94 | 94 | } |
| 95 | 95 | break; |
| 96 | 96 | case 'new': |
| 97 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'post-new.php' ) { |
|
| 97 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'post-new.php') { |
|
| 98 | 98 | $found = true; |
| 99 | 99 | } |
| 100 | 100 | break; |
| 101 | 101 | default: |
| 102 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) || 'give_forms' === $post_type || ( 'post-new.php' == $pagenow && 'give_forms' === $post_type ) ) { |
|
| 102 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) || 'give_forms' === $post_type || ('post-new.php' == $pagenow && 'give_forms' === $post_type)) { |
|
| 103 | 103 | $found = true; |
| 104 | 104 | } |
| 105 | 105 | break; |
| 106 | 106 | } |
| 107 | 107 | break; |
| 108 | 108 | case 'categories': |
| 109 | - switch ( $passed_view ) { |
|
| 109 | + switch ($passed_view) { |
|
| 110 | 110 | case 'list-table': |
| 111 | 111 | case 'new': |
| 112 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_category' === $taxonomy ) { |
|
| 112 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_category' === $taxonomy) { |
|
| 113 | 113 | $found = true; |
| 114 | 114 | } |
| 115 | 115 | break; |
| 116 | 116 | case 'edit': |
| 117 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_category' === $taxonomy ) { |
|
| 117 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_category' === $taxonomy) { |
|
| 118 | 118 | $found = true; |
| 119 | 119 | } |
| 120 | 120 | break; |
| 121 | 121 | default: |
| 122 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'give_forms_category' === $taxonomy ) { |
|
| 122 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'give_forms_category' === $taxonomy) { |
|
| 123 | 123 | $found = true; |
| 124 | 124 | } |
| 125 | 125 | break; |
| 126 | 126 | } |
| 127 | 127 | break; |
| 128 | 128 | case 'tags': |
| 129 | - switch ( $passed_view ) { |
|
| 129 | + switch ($passed_view) { |
|
| 130 | 130 | case 'list-table': |
| 131 | 131 | case 'new': |
| 132 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_tag' === $taxonomy ) { |
|
| 132 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_tag' === $taxonomy) { |
|
| 133 | 133 | $found = true; |
| 134 | 134 | } |
| 135 | 135 | break; |
| 136 | 136 | case 'edit': |
| 137 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_tag' === $taxonomy ) { |
|
| 137 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_tag' === $taxonomy) { |
|
| 138 | 138 | $found = true; |
| 139 | 139 | } |
| 140 | 140 | break; |
| 141 | 141 | default: |
| 142 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'give_forms_tag' === $taxonomy ) { |
|
| 142 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'give_forms_tag' === $taxonomy) { |
|
| 143 | 143 | $found = true; |
| 144 | 144 | } |
| 145 | 145 | break; |
| 146 | 146 | } |
| 147 | 147 | break; |
| 148 | 148 | case 'payments': |
| 149 | - switch ( $passed_view ) { |
|
| 149 | + switch ($passed_view) { |
|
| 150 | 150 | case 'list-table': |
| 151 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-payment-history' === $page && false === $view ) { |
|
| 151 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-payment-history' === $page && false === $view) { |
|
| 152 | 152 | $found = true; |
| 153 | 153 | } |
| 154 | 154 | break; |
| 155 | 155 | case 'edit': |
| 156 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-payment-history' === $page && 'view-order-details' === $view ) { |
|
| 156 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-payment-history' === $page && 'view-order-details' === $view) { |
|
| 157 | 157 | $found = true; |
| 158 | 158 | } |
| 159 | 159 | break; |
| 160 | 160 | default: |
| 161 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-payment-history' === $page ) { |
|
| 161 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-payment-history' === $page) { |
|
| 162 | 162 | $found = true; |
| 163 | 163 | } |
| 164 | 164 | break; |
| 165 | 165 | } |
| 166 | 166 | break; |
| 167 | 167 | case 'reports': |
| 168 | - switch ( $passed_view ) { |
|
| 168 | + switch ($passed_view) { |
|
| 169 | 169 | // If you want to do something like enqueue a script on a particular report's duration, look at $_GET[ 'range' ] |
| 170 | 170 | case 'earnings': |
| 171 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && ( 'earnings' === $view || '-1' === $view || false === $view ) ) { |
|
| 171 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && ('earnings' === $view || '-1' === $view || false === $view)) { |
|
| 172 | 172 | $found = true; |
| 173 | 173 | } |
| 174 | 174 | break; |
| 175 | 175 | case 'donors': |
| 176 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'customers' === $view ) { |
|
| 176 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'customers' === $view) { |
|
| 177 | 177 | $found = true; |
| 178 | 178 | } |
| 179 | 179 | break; |
| 180 | 180 | case 'gateways': |
| 181 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'gateways' === $view ) { |
|
| 181 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'gateways' === $view) { |
|
| 182 | 182 | $found = true; |
| 183 | 183 | } |
| 184 | 184 | break; |
| 185 | 185 | case 'export': |
| 186 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'export' === $view ) { |
|
| 186 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'export' === $view) { |
|
| 187 | 187 | $found = true; |
| 188 | 188 | } |
| 189 | 189 | break; |
| 190 | 190 | case 'logs': |
| 191 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'logs' === $view ) { |
|
| 191 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'logs' === $view) { |
|
| 192 | 192 | $found = true; |
| 193 | 193 | } |
| 194 | 194 | break; |
| 195 | 195 | default: |
| 196 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page ) { |
|
| 196 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page) { |
|
| 197 | 197 | $found = true; |
| 198 | 198 | } |
| 199 | 199 | break; |
| 200 | 200 | } |
| 201 | 201 | break; |
| 202 | 202 | case 'settings': |
| 203 | - switch ( $passed_view ) { |
|
| 203 | + switch ($passed_view) { |
|
| 204 | 204 | case 'general': |
| 205 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && ( 'general' === $tab || false === $tab ) ) { |
|
| 205 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && ('general' === $tab || false === $tab)) { |
|
| 206 | 206 | $found = true; |
| 207 | 207 | } |
| 208 | 208 | break; |
| 209 | 209 | case 'gateways': |
| 210 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'gateways' === $tab ) { |
|
| 210 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'gateways' === $tab) { |
|
| 211 | 211 | $found = true; |
| 212 | 212 | } |
| 213 | 213 | break; |
| 214 | 214 | case 'emails': |
| 215 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'emails' === $tab ) { |
|
| 215 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'emails' === $tab) { |
|
| 216 | 216 | $found = true; |
| 217 | 217 | } |
| 218 | 218 | break; |
| 219 | 219 | case 'display': |
| 220 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'display' === $tab ) { |
|
| 220 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'display' === $tab) { |
|
| 221 | 221 | $found = true; |
| 222 | 222 | } |
| 223 | 223 | break; |
| 224 | 224 | case 'licenses': |
| 225 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'licenses' === $tab ) { |
|
| 225 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'licenses' === $tab) { |
|
| 226 | 226 | $found = true; |
| 227 | 227 | } |
| 228 | 228 | break; |
| 229 | 229 | case 'api': |
| 230 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'api' === $tab ) { |
|
| 230 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'api' === $tab) { |
|
| 231 | 231 | $found = true; |
| 232 | 232 | } |
| 233 | 233 | break; |
| 234 | 234 | case 'advanced': |
| 235 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'advanced' === $tab ) { |
|
| 235 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'advanced' === $tab) { |
|
| 236 | 236 | $found = true; |
| 237 | 237 | } |
| 238 | 238 | break; |
| 239 | 239 | case 'system_info': |
| 240 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'system_info' === $tab ) { |
|
| 240 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'system_info' === $tab) { |
|
| 241 | 241 | $found = true; |
| 242 | 242 | } |
| 243 | 243 | break; |
| 244 | 244 | default: |
| 245 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page ) { |
|
| 245 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page) { |
|
| 246 | 246 | $found = true; |
| 247 | 247 | } |
| 248 | 248 | break; |
| 249 | 249 | } |
| 250 | 250 | break; |
| 251 | 251 | case 'addons': |
| 252 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-addons' === $page ) { |
|
| 252 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-addons' === $page) { |
|
| 253 | 253 | $found = true; |
| 254 | 254 | } |
| 255 | 255 | break; |
| 256 | 256 | case 'donors': |
| 257 | - switch ( $passed_view ) { |
|
| 257 | + switch ($passed_view) { |
|
| 258 | 258 | case 'list-table': |
| 259 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page && false === $view ) { |
|
| 259 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page && false === $view) { |
|
| 260 | 260 | $found = true; |
| 261 | 261 | } |
| 262 | 262 | break; |
| 263 | 263 | case 'overview': |
| 264 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page && 'overview' === $view ) { |
|
| 264 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page && 'overview' === $view) { |
|
| 265 | 265 | $found = true; |
| 266 | 266 | } |
| 267 | 267 | break; |
| 268 | 268 | case 'notes': |
| 269 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page && 'notes' === $view ) { |
|
| 269 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page && 'notes' === $view) { |
|
| 270 | 270 | $found = true; |
| 271 | 271 | } |
| 272 | 272 | break; |
| 273 | 273 | default: |
| 274 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page ) { |
|
| 274 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page) { |
|
| 275 | 275 | $found = true; |
| 276 | 276 | } |
| 277 | 277 | break; |
| 278 | 278 | } |
| 279 | 279 | break; |
| 280 | 280 | case 'reports': |
| 281 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page ) { |
|
| 281 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page) { |
|
| 282 | 282 | $found = true; |
| 283 | 283 | } |
| 284 | 284 | break; |
| 285 | 285 | default: |
| 286 | 286 | global $give_payments_page, $give_settings_page, $give_reports_page, $give_system_info_page, $give_add_ons_page, $give_settings_export, $give_upgrades_screen, $give_customers_page; |
| 287 | 287 | |
| 288 | - $admin_pages = apply_filters( 'give_admin_pages', array( |
|
| 288 | + $admin_pages = apply_filters('give_admin_pages', array( |
|
| 289 | 289 | $give_payments_page, |
| 290 | 290 | $give_settings_page, |
| 291 | 291 | $give_reports_page, |
@@ -294,18 +294,18 @@ discard block |
||
| 294 | 294 | $give_upgrades_screen, |
| 295 | 295 | $give_settings_export, |
| 296 | 296 | $give_customers_page |
| 297 | - ) ); |
|
| 298 | - if ( 'give_forms' == $typenow || 'index.php' == $pagenow || 'post-new.php' == $pagenow || 'post.php' == $pagenow ) { |
|
| 297 | + )); |
|
| 298 | + if ('give_forms' == $typenow || 'index.php' == $pagenow || 'post-new.php' == $pagenow || 'post.php' == $pagenow) { |
|
| 299 | 299 | $found = true; |
| 300 | - if ( 'give-upgrades' === $page ) { |
|
| 300 | + if ('give-upgrades' === $page) { |
|
| 301 | 301 | $found = false; |
| 302 | 302 | } |
| 303 | - } elseif ( in_array( $pagenow, $admin_pages ) ) { |
|
| 303 | + } elseif (in_array($pagenow, $admin_pages)) { |
|
| 304 | 304 | $found = true; |
| 305 | 305 | } |
| 306 | 306 | break; |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | - return (bool) apply_filters( 'give_is_admin_page', $found, $page, $view, $passed_page, $passed_view ); |
|
| 309 | + return (bool) apply_filters('give_is_admin_page', $found, $page, $view, $passed_page, $passed_view); |
|
| 310 | 310 | |
| 311 | 311 | } |
| 312 | 312 | \ No newline at end of file |
@@ -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 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | * |
| 24 | 24 | * @return array The altered list of views |
| 25 | 25 | */ |
| 26 | -function give_register_default_customer_views( $views ) { |
|
| 26 | +function give_register_default_customer_views($views) { |
|
| 27 | 27 | |
| 28 | 28 | $default_views = array( |
| 29 | 29 | 'overview' => 'give_customers_view', |
@@ -31,11 +31,11 @@ discard block |
||
| 31 | 31 | 'notes' => 'give_customer_notes_view' |
| 32 | 32 | ); |
| 33 | 33 | |
| 34 | - return array_merge( $views, $default_views ); |
|
| 34 | + return array_merge($views, $default_views); |
|
| 35 | 35 | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -add_filter( 'give_customer_views', 'give_register_default_customer_views', 1, 1 ); |
|
| 38 | +add_filter('give_customer_views', 'give_register_default_customer_views', 1, 1); |
|
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * Register a tab for the single customer view |
@@ -46,17 +46,17 @@ discard block |
||
| 46 | 46 | * |
| 47 | 47 | * @return array The altered list of tabs |
| 48 | 48 | */ |
| 49 | -function give_register_default_customer_tabs( $tabs ) { |
|
| 49 | +function give_register_default_customer_tabs($tabs) { |
|
| 50 | 50 | |
| 51 | 51 | $default_tabs = array( |
| 52 | - 'overview' => array( 'dashicon' => 'dashicons-admin-users', 'title' => esc_html__( 'Donor Profile', 'give' ) ), |
|
| 53 | - 'notes' => array( 'dashicon' => 'dashicons-admin-comments', 'title' => esc_html__( 'Donor Notes', 'give' ) ) |
|
| 52 | + 'overview' => array('dashicon' => 'dashicons-admin-users', 'title' => esc_html__('Donor Profile', 'give')), |
|
| 53 | + 'notes' => array('dashicon' => 'dashicons-admin-comments', 'title' => esc_html__('Donor Notes', 'give')) |
|
| 54 | 54 | ); |
| 55 | 55 | |
| 56 | - return array_merge( $tabs, $default_tabs ); |
|
| 56 | + return array_merge($tabs, $default_tabs); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | -add_filter( 'give_customer_tabs', 'give_register_default_customer_tabs', 1, 1 ); |
|
| 59 | +add_filter('give_customer_tabs', 'give_register_default_customer_tabs', 1, 1); |
|
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | 62 | * Register the Delete icon as late as possible so it's at the bottom |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | * |
| 68 | 68 | * @return array The altered list of tabs, with 'delete' at the bottom |
| 69 | 69 | */ |
| 70 | -function give_register_delete_customer_tab( $tabs ) { |
|
| 70 | +function give_register_delete_customer_tab($tabs) { |
|
| 71 | 71 | |
| 72 | - $tabs['delete'] = array( 'dashicon' => 'dashicons-trash', 'title' => esc_html__( 'Delete Donor', 'give' ) ); |
|
| 72 | + $tabs['delete'] = array('dashicon' => 'dashicons-trash', 'title' => esc_html__('Delete Donor', 'give')); |
|
| 73 | 73 | |
| 74 | 74 | return $tabs; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | -add_filter( 'give_customer_tabs', 'give_register_delete_customer_tab', PHP_INT_MAX, 1 ); |
|
| 77 | +add_filter('give_customer_tabs', 'give_register_delete_customer_tab', PHP_INT_MAX, 1); |
|
@@ -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 | |
@@ -29,8 +29,8 @@ discard block |
||
| 29 | 29 | * @see Give_Cron::weekly_events() |
| 30 | 30 | */ |
| 31 | 31 | public function __construct() { |
| 32 | - add_filter( 'cron_schedules', array( $this, 'add_schedules' ) ); |
|
| 33 | - add_action( 'wp', array( $this, 'schedule_Events' ) ); |
|
| 32 | + add_filter('cron_schedules', array($this, 'add_schedules')); |
|
| 33 | + add_action('wp', array($this, 'schedule_Events')); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -42,11 +42,11 @@ discard block |
||
| 42 | 42 | * |
| 43 | 43 | * @return array |
| 44 | 44 | */ |
| 45 | - public function add_schedules( $schedules = array() ) { |
|
| 45 | + public function add_schedules($schedules = array()) { |
|
| 46 | 46 | // Adds once weekly to the existing schedules. |
| 47 | 47 | $schedules['weekly'] = array( |
| 48 | 48 | 'interval' => 604800, |
| 49 | - 'display' => esc_html__( 'Once Weekly', 'give' ) |
|
| 49 | + 'display' => esc_html__('Once Weekly', 'give') |
|
| 50 | 50 | ); |
| 51 | 51 | |
| 52 | 52 | return $schedules; |
@@ -72,8 +72,8 @@ discard block |
||
| 72 | 72 | * @return void |
| 73 | 73 | */ |
| 74 | 74 | private function weekly_events() { |
| 75 | - if ( ! wp_next_scheduled( 'give_weekly_scheduled_events' ) ) { |
|
| 76 | - wp_schedule_event( current_time( 'timestamp' ), 'weekly', 'give_weekly_scheduled_events' ); |
|
| 75 | + if ( ! wp_next_scheduled('give_weekly_scheduled_events')) { |
|
| 76 | + wp_schedule_event(current_time('timestamp'), 'weekly', 'give_weekly_scheduled_events'); |
|
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | |
@@ -85,8 +85,8 @@ discard block |
||
| 85 | 85 | * @return void |
| 86 | 86 | */ |
| 87 | 87 | private function daily_events() { |
| 88 | - if ( ! wp_next_scheduled( 'give_daily_scheduled_events' ) ) { |
|
| 89 | - wp_schedule_event( current_time( 'timestamp' ), 'daily', 'give_daily_scheduled_events' ); |
|
| 88 | + if ( ! wp_next_scheduled('give_daily_scheduled_events')) { |
|
| 89 | + wp_schedule_event(current_time('timestamp'), 'daily', 'give_daily_scheduled_events'); |
|
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | |