@@ -8,33 +8,33 @@ |
||
8 | 8 | interface SetHooksInterface |
9 | 9 | { |
10 | 10 | |
11 | - /** |
|
12 | - * a place to add action and filter hooks for regular frontend requests |
|
13 | - * |
|
14 | - * @return void |
|
15 | - */ |
|
16 | - public function setHooks(); |
|
17 | - |
|
18 | - /** |
|
19 | - * a place to add action and filter hooks for regular WP admin requests |
|
20 | - * |
|
21 | - * @return void |
|
22 | - */ |
|
23 | - public function setAdminHooks(); |
|
24 | - |
|
25 | - /** |
|
26 | - * a place to add action and filter hooks for AJAX requests |
|
27 | - * |
|
28 | - * @return void |
|
29 | - */ |
|
30 | - public function setAjaxHooks(); |
|
31 | - |
|
32 | - /** |
|
33 | - * a place to add action and filter hooks for REST API requests |
|
34 | - * |
|
35 | - * @return void |
|
36 | - */ |
|
37 | - public function setApiHooks(); |
|
11 | + /** |
|
12 | + * a place to add action and filter hooks for regular frontend requests |
|
13 | + * |
|
14 | + * @return void |
|
15 | + */ |
|
16 | + public function setHooks(); |
|
17 | + |
|
18 | + /** |
|
19 | + * a place to add action and filter hooks for regular WP admin requests |
|
20 | + * |
|
21 | + * @return void |
|
22 | + */ |
|
23 | + public function setAdminHooks(); |
|
24 | + |
|
25 | + /** |
|
26 | + * a place to add action and filter hooks for AJAX requests |
|
27 | + * |
|
28 | + * @return void |
|
29 | + */ |
|
30 | + public function setAjaxHooks(); |
|
31 | + |
|
32 | + /** |
|
33 | + * a place to add action and filter hooks for REST API requests |
|
34 | + * |
|
35 | + * @return void |
|
36 | + */ |
|
37 | + public function setApiHooks(); |
|
38 | 38 | |
39 | 39 | } |
40 | 40 | // End of file SetHooksInterface.php |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @param WP $WP |
32 | 32 | * @return void |
33 | 33 | */ |
34 | - public function run( WP $WP ) { |
|
34 | + public function run(WP $WP) { |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @param array $attributes |
42 | 42 | * @return string |
43 | 43 | */ |
44 | - public function process_shortcode( $attributes = array() ) { |
|
44 | + public function process_shortcode($attributes = array()) { |
|
45 | 45 | \EE_Error::doing_it_wrong( |
46 | 46 | __METHOD__, |
47 | 47 | __( |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * ESPRESSO_EVENTS |
4 | 6 | * |
@@ -10,15 +10,15 @@ discard block |
||
10 | 10 | class EES_Espresso_Events extends EES_Shortcode { |
11 | 11 | |
12 | 12 | /** |
13 | - * @deprecated 4.9.27 |
|
14 | - * @return void |
|
13 | + * @deprecated 4.9.27 |
|
14 | + * @return void |
|
15 | 15 | */ |
16 | 16 | public static function set_hooks() { |
17 | 17 | } |
18 | 18 | |
19 | 19 | /** |
20 | - * @deprecated 4.9.27 |
|
21 | - * @return void |
|
20 | + * @deprecated 4.9.27 |
|
21 | + * @return void |
|
22 | 22 | */ |
23 | 23 | public static function set_hooks_admin() { |
24 | 24 | } |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | |
27 | 27 | |
28 | 28 | /** |
29 | - * @deprecated 4.9.27 |
|
30 | - * @param WP $WP |
|
29 | + * @deprecated 4.9.27 |
|
30 | + * @param WP $WP |
|
31 | 31 | * @return void |
32 | 32 | */ |
33 | 33 | public function run( WP $WP ) { |
@@ -36,21 +36,21 @@ discard block |
||
36 | 36 | |
37 | 37 | |
38 | 38 | /** |
39 | - * @deprecated 4.9.27 |
|
40 | - * @param array $attributes |
|
39 | + * @deprecated 4.9.27 |
|
40 | + * @param array $attributes |
|
41 | 41 | * @return string |
42 | 42 | */ |
43 | 43 | public function process_shortcode( $attributes = array() ) { |
44 | - \EE_Error::doing_it_wrong( |
|
45 | - __METHOD__, |
|
46 | - __( |
|
47 | - 'Usage is deprecated. Please use \EventEspresso\core\domain\entities\shortcodes\EspressoEvents instead.', |
|
48 | - 'event_espresso' |
|
49 | - ), |
|
50 | - '4.9.27' |
|
51 | - ); |
|
52 | - return ''; |
|
53 | - } |
|
44 | + \EE_Error::doing_it_wrong( |
|
45 | + __METHOD__, |
|
46 | + __( |
|
47 | + 'Usage is deprecated. Please use \EventEspresso\core\domain\entities\shortcodes\EspressoEvents instead.', |
|
48 | + 'event_espresso' |
|
49 | + ), |
|
50 | + '4.9.27' |
|
51 | + ); |
|
52 | + return ''; |
|
53 | + } |
|
54 | 54 | |
55 | 55 | |
56 | 56 |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {exit('No direct script access allowed');} |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {exit('No direct script access allowed'); } |
|
2 | 2 | /** |
3 | 3 | * EES_Espresso_Txn_Page |
4 | 4 | * |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @throws \Exception |
58 | 58 | * @throws \EE_Error |
59 | 59 | */ |
60 | - public function run( WP $WP ) { |
|
60 | + public function run(WP $WP) { |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | * @param array $attributes |
69 | 69 | * @return string |
70 | 70 | */ |
71 | - public function process_shortcode( $attributes = array() ) { |
|
72 | - return __( 'This is the Event Espresso Transactions page. This page receives instant payment notification (IPN) requests and should have a status of published, but should not be easily accessible by site visitors. Do not add it to your website\'s navigation menu or link to it from another page. Also, do not delete it or change its status to private.', 'event_espresso' ); |
|
71 | + public function process_shortcode($attributes = array()) { |
|
72 | + return __('This is the Event Espresso Transactions page. This page receives instant payment notification (IPN) requests and should have a status of published, but should not be easily accessible by site visitors. Do not add it to your website\'s navigation menu or link to it from another page. Also, do not delete it or change its status to private.', 'event_espresso'); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 |
@@ -11,15 +11,15 @@ discard block |
||
11 | 11 | |
12 | 12 | |
13 | 13 | /** |
14 | - * @deprecated 4.9.27 |
|
15 | - * @return void |
|
14 | + * @deprecated 4.9.27 |
|
15 | + * @return void |
|
16 | 16 | */ |
17 | 17 | public static function set_hooks() { |
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
21 | - * @deprecated 4.9.27 |
|
22 | - * @return void |
|
21 | + * @deprecated 4.9.27 |
|
22 | + * @return void |
|
23 | 23 | */ |
24 | 24 | public static function set_hooks_admin() { |
25 | 25 | } |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | |
28 | 28 | |
29 | 29 | /** |
30 | - * @deprecated 4.9.27 |
|
31 | - * @return void |
|
30 | + * @deprecated 4.9.27 |
|
31 | + * @return void |
|
32 | 32 | */ |
33 | 33 | public static function set_definitions() { |
34 | 34 | } |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | |
37 | 37 | |
38 | 38 | /** |
39 | - * @deprecated 4.9.27 |
|
40 | - * @param WP $WP |
|
39 | + * @deprecated 4.9.27 |
|
40 | + * @param WP $WP |
|
41 | 41 | * @return void |
42 | 42 | * @throws \Exception |
43 | 43 | * @throws \EE_Error |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | |
50 | 50 | |
51 | 51 | /** |
52 | - * @deprecated 4.9.27 |
|
53 | - * @param array $attributes |
|
52 | + * @deprecated 4.9.27 |
|
53 | + * @param array $attributes |
|
54 | 54 | * @return string |
55 | 55 | */ |
56 | 56 | public function process_shortcode( $attributes = array() ) { |
@@ -1,15 +1,15 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | //echo '<br/><h6 style="color:#2EA2CC;">'. __FILE__ . ' <span style="font-weight:normal;color:#E76700"> Line #: ' . __LINE__ . '</span></h6>'; |
3 | 3 | global $post; |
4 | -do_action( 'AHEE_event_details_before_featured_img', $post ); |
|
4 | +do_action('AHEE_event_details_before_featured_img', $post); |
|
5 | 5 | |
6 | -if ( has_post_thumbnail( $post->ID )) : |
|
7 | - if ( $img_ID = get_post_thumbnail_id( $post->ID )) : |
|
8 | - if ( $featured_img = wp_get_attachment_image_src( $img_ID, 'large' )) : |
|
9 | - $caption = esc_attr( get_post( get_post( $img_ID ))->post_excerpt ); |
|
6 | +if (has_post_thumbnail($post->ID)) : |
|
7 | + if ($img_ID = get_post_thumbnail_id($post->ID)) : |
|
8 | + if ($featured_img = wp_get_attachment_image_src($img_ID, 'large')) : |
|
9 | + $caption = esc_attr(get_post(get_post($img_ID))->post_excerpt); |
|
10 | 10 | ?> |
11 | 11 | <div id="ee-event-img-dv-<?php echo $post->ID; ?>" class="ee-event-img-dv"> |
12 | - <a class="ee-event-img-lnk" href="<?php the_permalink(); ?>"<?php echo \EED_Events_Archive::link_target();?>> |
|
12 | + <a class="ee-event-img-lnk" href="<?php the_permalink(); ?>"<?php echo \EED_Events_Archive::link_target(); ?>> |
|
13 | 13 | <img class="ee-event-img" src="<?php echo $featured_img[0]; ?>" width="<?php echo $featured_img[1]; ?>" height="<?php echo $featured_img[2]; ?>" alt="<?php echo $caption; ?>"/> |
14 | 14 | </a> |
15 | 15 | </div> |
@@ -18,4 +18,4 @@ discard block |
||
18 | 18 | endif; |
19 | 19 | endif; |
20 | 20 | ?> |
21 | -<?php do_action( 'AHEE_event_details_after_featured_img', $post );?> |
|
21 | +<?php do_action('AHEE_event_details_after_featured_img', $post); ?> |
@@ -5,9 +5,9 @@ |
||
5 | 5 | ?> |
6 | 6 | <header class="event-header"> |
7 | 7 | <?php echo "<{$tag} id=\"event-details-{$tag}-{$post->ID}\" class=\"entry-title\">"; ?> |
8 | - <a class="ee-event-header-lnk" href="<?php the_permalink(); ?>"<?php echo \EED_Events_Archive::link_target();?>> |
|
8 | + <a class="ee-event-header-lnk" href="<?php the_permalink(); ?>"<?php echo \EED_Events_Archive::link_target(); ?>> |
|
9 | 9 | <?php the_title(); ?> |
10 | 10 | </a> |
11 | 11 | <?php echo "</{$tag}"; ?> |
12 | - <?php if ( ! is_archive() && has_excerpt( $post->ID )): the_excerpt(); endif;?> |
|
12 | + <?php if ( ! is_archive() && has_excerpt($post->ID)): the_excerpt(); endif; ?> |
|
13 | 13 | </header> |
@@ -155,14 +155,14 @@ discard block |
||
155 | 155 | wp_enqueue_script( 'batch_runner', EE_PLUGIN_DIR_URL . 'core/libraries/batch/Assets/batch_runner.js', array( 'progress_bar' )); |
156 | 156 | //just copy the bits of EE admin's eei18n that we need in the JS |
157 | 157 | wp_localize_script( |
158 | - 'batch_runner', |
|
159 | - 'eei18n', |
|
160 | - array( |
|
161 | - 'ajax_url' => WP_AJAX_URL, |
|
162 | - 'is_admin' => (bool)is_admin(), |
|
163 | - 'error_message' => esc_html__('An error occurred and the job has been stopped.', 'event_espresso') |
|
164 | - ) |
|
165 | - ); |
|
158 | + 'batch_runner', |
|
159 | + 'eei18n', |
|
160 | + array( |
|
161 | + 'ajax_url' => WP_AJAX_URL, |
|
162 | + 'is_admin' => (bool)is_admin(), |
|
163 | + 'error_message' => esc_html__('An error occurred and the job has been stopped.', 'event_espresso') |
|
164 | + ) |
|
165 | + ); |
|
166 | 166 | $job_handler_classname = stripslashes( $_GET[ 'job_handler' ] ); |
167 | 167 | $request_data = array_diff_key( |
168 | 168 | $_REQUEST, |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | if ( NULL === error_get_last() || ! headers_sent() ) { |
259 | 259 | header('Content-Type: application/json; charset=UTF-8'); |
260 | 260 | } |
261 | - echo wp_json_encode( $json ); |
|
261 | + echo wp_json_encode( $json ); |
|
262 | 262 | exit(); |
263 | 263 | } |
264 | 264 |
@@ -17,13 +17,13 @@ discard block |
||
17 | 17 | * @since 4.8.30.rc.007 |
18 | 18 | * |
19 | 19 | */ |
20 | -if( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
21 | - exit( 'No direct script access allowed' ); |
|
20 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
21 | + exit('No direct script access allowed'); |
|
22 | 22 | } |
23 | 23 | |
24 | -define( 'BATCH_URL', plugin_dir_url( __FILE__ ) ); |
|
24 | +define('BATCH_URL', plugin_dir_url(__FILE__)); |
|
25 | 25 | |
26 | -class EED_Batch extends EED_Module{ |
|
26 | +class EED_Batch extends EED_Module { |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * Possibly value for $_REQUEST[ 'batch' ]. Indicates to run a job that |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | public static function set_hooks() { |
71 | 71 | //because this is a possibel attack vector, let's have this disabled until |
72 | 72 | //we at least have a real use for it on the frontend |
73 | - if( apply_filters( 'FHEE__EED_Batch__set_hooks__enable_frontend_batch', false ) ) { |
|
74 | - add_action( 'wp_enqueue_scripts', array( self::instance(), 'enqueue_scripts' ) ); |
|
75 | - add_filter( 'template_include', array( self::instance(), 'override_template' ), 99 ); |
|
73 | + if (apply_filters('FHEE__EED_Batch__set_hooks__enable_frontend_batch', false)) { |
|
74 | + add_action('wp_enqueue_scripts', array(self::instance(), 'enqueue_scripts')); |
|
75 | + add_filter('template_include', array(self::instance(), 'override_template'), 99); |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
@@ -80,28 +80,28 @@ discard block |
||
80 | 80 | * Initializes some hooks for the admin in order to run batch jobs |
81 | 81 | */ |
82 | 82 | public static function set_hooks_admin() { |
83 | - add_action( 'admin_menu', array( self::instance(), 'register_admin_pages' ) ); |
|
84 | - add_action( 'admin_enqueue_scripts', array( self::instance(), 'enqueue_scripts' ) ); |
|
83 | + add_action('admin_menu', array(self::instance(), 'register_admin_pages')); |
|
84 | + add_action('admin_enqueue_scripts', array(self::instance(), 'enqueue_scripts')); |
|
85 | 85 | |
86 | 86 | //ajax |
87 | - add_action('wp_ajax_espresso_batch_continue',array(self::instance(),'batch_continue')); |
|
88 | - add_action('wp_ajax_espresso_batch_cleanup',array(self::instance(),'batch_cleanup')); |
|
89 | - add_action('wp_ajax_nopriv_espresso_batch_continue',array(self::instance(),'batch_continue')); |
|
90 | - add_action('wp_ajax_nopriv_espresso_batch_cleanup',array(self::instance(),'batch_cleanup')); |
|
87 | + add_action('wp_ajax_espresso_batch_continue', array(self::instance(), 'batch_continue')); |
|
88 | + add_action('wp_ajax_espresso_batch_cleanup', array(self::instance(), 'batch_cleanup')); |
|
89 | + add_action('wp_ajax_nopriv_espresso_batch_continue', array(self::instance(), 'batch_continue')); |
|
90 | + add_action('wp_ajax_nopriv_espresso_batch_cleanup', array(self::instance(), 'batch_cleanup')); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
94 | 94 | * Enqueues batch scripts on the frontend or admin, and creates a job |
95 | 95 | */ |
96 | 96 | public function enqueue_scripts() { |
97 | - if( isset( $_REQUEST[ 'espresso_batch' ] ) |
|
97 | + if (isset($_REQUEST['espresso_batch']) |
|
98 | 98 | || |
99 | 99 | ( |
100 | - isset( $_REQUEST[ 'page' ] ) |
|
101 | - && $_REQUEST[ 'page' ] == 'espresso_batch' |
|
100 | + isset($_REQUEST['page']) |
|
101 | + && $_REQUEST['page'] == 'espresso_batch' |
|
102 | 102 | ) |
103 | 103 | ) { |
104 | - switch( $this->batch_request_type() ) { |
|
104 | + switch ($this->batch_request_type()) { |
|
105 | 105 | case self::batch_job: |
106 | 106 | $this->enqueue_scripts_styles_batch_create(); |
107 | 107 | break; |
@@ -117,11 +117,11 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function enqueue_scripts_styles_batch_create() { |
119 | 119 | $job_response = $this->_enqueue_batch_job_scripts_and_styles_and_start_job(); |
120 | - wp_enqueue_script( 'batch_runner_init', BATCH_URL . 'assets/batch_runner_init.js', array( 'batch_runner' ), EVENT_ESPRESSO_VERSION, true ); |
|
121 | - wp_localize_script( 'batch_runner_init', 'ee_job_response', $job_response->to_array() ); |
|
122 | - wp_localize_script( 'batch_runner_init', 'ee_job_i18n', |
|
120 | + wp_enqueue_script('batch_runner_init', BATCH_URL.'assets/batch_runner_init.js', array('batch_runner'), EVENT_ESPRESSO_VERSION, true); |
|
121 | + wp_localize_script('batch_runner_init', 'ee_job_response', $job_response->to_array()); |
|
122 | + wp_localize_script('batch_runner_init', 'ee_job_i18n', |
|
123 | 123 | array( |
124 | - 'return_url' => $_REQUEST['return_url' ], |
|
124 | + 'return_url' => $_REQUEST['return_url'], |
|
125 | 125 | )); |
126 | 126 | } |
127 | 127 | |
@@ -131,15 +131,15 @@ discard block |
||
131 | 131 | public function enqueue_scripts_styles_batch_file_create() { |
132 | 132 | //creates a job based on the request variable |
133 | 133 | $job_response = $this->_enqueue_batch_job_scripts_and_styles_and_start_job(); |
134 | - wp_enqueue_script( 'batch_file_runner_init', BATCH_URL . 'assets/batch_file_runner_init.js', array( 'batch_runner' ), EVENT_ESPRESSO_VERSION, true ); |
|
135 | - wp_localize_script( 'batch_file_runner_init', 'ee_job_response', $job_response->to_array() ); |
|
136 | - wp_localize_script( 'batch_file_runner_init', 'ee_job_i18n', |
|
134 | + wp_enqueue_script('batch_file_runner_init', BATCH_URL.'assets/batch_file_runner_init.js', array('batch_runner'), EVENT_ESPRESSO_VERSION, true); |
|
135 | + wp_localize_script('batch_file_runner_init', 'ee_job_response', $job_response->to_array()); |
|
136 | + wp_localize_script('batch_file_runner_init', 'ee_job_i18n', |
|
137 | 137 | array( |
138 | 138 | 'download_and_redirecting' => sprintf( |
139 | 139 | __('File Generation complete. Downloading, and %1$sredirecting%2$s...', 'event_espresso'), |
140 | - '<a href="' . $_REQUEST['return_url' ] .'">', |
|
140 | + '<a href="'.$_REQUEST['return_url'].'">', |
|
141 | 141 | '</a>' ), |
142 | - 'return_url' => $_REQUEST['return_url' ], |
|
142 | + 'return_url' => $_REQUEST['return_url'], |
|
143 | 143 | )); |
144 | 144 | } |
145 | 145 | |
@@ -150,26 +150,26 @@ discard block |
||
150 | 150 | * @return \EventEspressoBatchRequest\Helpers\JobStepResponse |
151 | 151 | */ |
152 | 152 | protected function _enqueue_batch_job_scripts_and_styles_and_start_job() { |
153 | - wp_register_script( 'progress_bar', EE_PLUGIN_DIR_URL . 'core/libraries/batch/Assets/progress_bar.js', array( 'jquery' ) ); |
|
154 | - wp_enqueue_style( 'progress_bar', EE_PLUGIN_DIR_URL . 'core/libraries/batch/Assets/progress_bar.css', array(), EVENT_ESPRESSO_VERSION ); |
|
155 | - wp_enqueue_script( 'batch_runner', EE_PLUGIN_DIR_URL . 'core/libraries/batch/Assets/batch_runner.js', array( 'progress_bar' )); |
|
153 | + wp_register_script('progress_bar', EE_PLUGIN_DIR_URL.'core/libraries/batch/Assets/progress_bar.js', array('jquery')); |
|
154 | + wp_enqueue_style('progress_bar', EE_PLUGIN_DIR_URL.'core/libraries/batch/Assets/progress_bar.css', array(), EVENT_ESPRESSO_VERSION); |
|
155 | + wp_enqueue_script('batch_runner', EE_PLUGIN_DIR_URL.'core/libraries/batch/Assets/batch_runner.js', array('progress_bar')); |
|
156 | 156 | //just copy the bits of EE admin's eei18n that we need in the JS |
157 | 157 | wp_localize_script( |
158 | 158 | 'batch_runner', |
159 | 159 | 'eei18n', |
160 | 160 | array( |
161 | 161 | 'ajax_url' => WP_AJAX_URL, |
162 | - 'is_admin' => (bool)is_admin(), |
|
162 | + 'is_admin' => (bool) is_admin(), |
|
163 | 163 | 'error_message' => esc_html__('An error occurred and the job has been stopped.', 'event_espresso') |
164 | 164 | ) |
165 | 165 | ); |
166 | - $job_handler_classname = stripslashes( $_GET[ 'job_handler' ] ); |
|
166 | + $job_handler_classname = stripslashes($_GET['job_handler']); |
|
167 | 167 | $request_data = array_diff_key( |
168 | 168 | $_REQUEST, |
169 | - array_flip( array( 'action', 'page', 'ee', 'batch' ) ) ); |
|
169 | + array_flip(array('action', 'page', 'ee', 'batch')) ); |
|
170 | 170 | $batch_runner = new EventEspressoBatchRequest\BatchRequestProcessor(); |
171 | 171 | //eg 'EventEspressoBatchRequest\JobHandlers\RegistrationsReport' |
172 | - $job_response = $batch_runner->create_job( $job_handler_classname, $request_data ); |
|
172 | + $job_response = $batch_runner->create_job($job_handler_classname, $request_data); |
|
173 | 173 | //remember the response for later. We need it to display the page body |
174 | 174 | $this->_job_step_response = $job_response; |
175 | 175 | return $job_response; |
@@ -180,9 +180,9 @@ discard block |
||
180 | 180 | * @param string $template |
181 | 181 | * @return string |
182 | 182 | */ |
183 | - public function override_template( $template ) { |
|
184 | - if( isset( $_REQUEST[ 'espresso_batch' ] ) && isset( $_REQUEST[ 'batch' ] ) ) { |
|
185 | - return EE_MODULES . 'batch' . DS . 'templates' . DS . 'batch_frontend_wrapper.template.html'; |
|
183 | + public function override_template($template) { |
|
184 | + if (isset($_REQUEST['espresso_batch']) && isset($_REQUEST['batch'])) { |
|
185 | + return EE_MODULES.'batch'.DS.'templates'.DS.'batch_frontend_wrapper.template.html'; |
|
186 | 186 | } |
187 | 187 | return $template; |
188 | 188 | } |
@@ -193,11 +193,11 @@ discard block |
||
193 | 193 | public function register_admin_pages() { |
194 | 194 | add_submenu_page( |
195 | 195 | '', //parent slug. we don't want this to actually appear in the menu |
196 | - __( 'Batch Job', 'event_espresso' ), //page title |
|
196 | + __('Batch Job', 'event_espresso'), //page title |
|
197 | 197 | 'n/a', //menu title |
198 | 198 | 'read', //we want this page to actually be accessible to anyone, |
199 | 199 | 'espresso_batch', //menu slug |
200 | - array( self::instance(), 'show_admin_page' ) |
|
200 | + array(self::instance(), 'show_admin_page') |
|
201 | 201 | ); |
202 | 202 | } |
203 | 203 | |
@@ -207,8 +207,8 @@ discard block |
||
207 | 207 | */ |
208 | 208 | public function show_admin_page() { |
209 | 209 | echo EEH_Template::locate_template( |
210 | - EE_MODULES . 'batch' . DS . 'templates' . DS . 'batch_wrapper.template.html', |
|
211 | - array( 'batch_request_type' => $this->batch_request_type() ) |
|
210 | + EE_MODULES.'batch'.DS.'templates'.DS.'batch_wrapper.template.html', |
|
211 | + array('batch_request_type' => $this->batch_request_type()) |
|
212 | 212 | ); |
213 | 213 | } |
214 | 214 | |
@@ -216,10 +216,10 @@ discard block |
||
216 | 216 | * Receives ajax calls for continuing a job |
217 | 217 | */ |
218 | 218 | public function batch_continue() { |
219 | - $job_id = sanitize_text_field( $_REQUEST[ 'job_id' ] ); |
|
219 | + $job_id = sanitize_text_field($_REQUEST['job_id']); |
|
220 | 220 | $batch_runner = new EventEspressoBatchRequest\BatchRequestProcessor(); |
221 | - $response_obj = $batch_runner->continue_job( $job_id); |
|
222 | - $this->_return_json( $response_obj->to_array() ); |
|
221 | + $response_obj = $batch_runner->continue_job($job_id); |
|
222 | + $this->_return_json($response_obj->to_array()); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | /** |
@@ -227,10 +227,10 @@ discard block |
||
227 | 227 | * @return type |
228 | 228 | */ |
229 | 229 | public function batch_cleanup() { |
230 | - $job_id = sanitize_text_field( $_REQUEST[ 'job_id' ] ); |
|
230 | + $job_id = sanitize_text_field($_REQUEST['job_id']); |
|
231 | 231 | $batch_runner = new EventEspressoBatchRequest\BatchRequestProcessor(); |
232 | - $response_obj = $batch_runner->cleanup_job( $job_id ); |
|
233 | - $this->_return_json( $response_obj->to_array() ); |
|
232 | + $response_obj = $batch_runner->cleanup_job($job_id); |
|
233 | + $this->_return_json($response_obj->to_array()); |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | * 'isEEajax' => true,//indicates this is a response from EE |
247 | 247 | * ) |
248 | 248 | */ |
249 | - protected function _return_json( $data ) { |
|
249 | + protected function _return_json($data) { |
|
250 | 250 | $json = array( |
251 | 251 | 'notices' => EE_Error::get_notices(), |
252 | 252 | 'data' => $data, |
@@ -255,10 +255,10 @@ discard block |
||
255 | 255 | |
256 | 256 | |
257 | 257 | // make sure there are no php errors or headers_sent. Then we can set correct json header. |
258 | - if ( NULL === error_get_last() || ! headers_sent() ) { |
|
258 | + if (NULL === error_get_last() || ! headers_sent()) { |
|
259 | 259 | header('Content-Type: application/json; charset=UTF-8'); |
260 | 260 | } |
261 | - echo wp_json_encode( $json ); |
|
261 | + echo wp_json_encode($json); |
|
262 | 262 | exit(); |
263 | 263 | } |
264 | 264 | |
@@ -274,16 +274,16 @@ discard block |
||
274 | 274 | * @return string: EED_Batch::batch_job, EED_Batch::batch_file_job, EED_Batch::batch_not_job |
275 | 275 | */ |
276 | 276 | public function batch_request_type() { |
277 | - if( $this->_batch_request_type === null ) { |
|
278 | - if( isset( $_GET[ 'batch' ] ) ) { |
|
279 | - if( $_GET[ 'batch' ] == self::batch_job ) { |
|
277 | + if ($this->_batch_request_type === null) { |
|
278 | + if (isset($_GET['batch'])) { |
|
279 | + if ($_GET['batch'] == self::batch_job) { |
|
280 | 280 | $this->_batch_request_type = self::batch_job; |
281 | - } elseif( $_GET[ 'batch' ] == self::batch_file_job ) { |
|
281 | + } elseif ($_GET['batch'] == self::batch_file_job) { |
|
282 | 282 | $this->_batch_request_type = self::batch_file_job; |
283 | 283 | } |
284 | 284 | } |
285 | 285 | //if we didn't find that it was a batch request, indicate it wasn't |
286 | - if( $this->_batch_request_type === null ) { |
|
286 | + if ($this->_batch_request_type === null) { |
|
287 | 287 | $this->_batch_request_type = self::batch_not_job; |
288 | 288 | } |
289 | 289 | } |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | * Unnecessary |
295 | 295 | * @param type $WP |
296 | 296 | */ |
297 | - public function run( $WP ) { |
|
297 | + public function run($WP) { |
|
298 | 298 | |
299 | 299 | } |
300 | 300 |
@@ -14,57 +14,57 @@ |
||
14 | 14 | class EES_Espresso_Cancelled extends EES_Shortcode |
15 | 15 | { |
16 | 16 | |
17 | - /** |
|
18 | - * @deprecated 4.9.27 |
|
19 | - * @return void |
|
20 | - */ |
|
21 | - public static function set_hooks() |
|
22 | - { |
|
23 | - } |
|
17 | + /** |
|
18 | + * @deprecated 4.9.27 |
|
19 | + * @return void |
|
20 | + */ |
|
21 | + public static function set_hooks() |
|
22 | + { |
|
23 | + } |
|
24 | 24 | |
25 | 25 | |
26 | 26 | |
27 | - /** |
|
28 | - * @deprecated 4.9.27 |
|
29 | - * @return void |
|
30 | - */ |
|
31 | - public static function set_hooks_admin() |
|
32 | - { |
|
33 | - } |
|
27 | + /** |
|
28 | + * @deprecated 4.9.27 |
|
29 | + * @return void |
|
30 | + */ |
|
31 | + public static function set_hooks_admin() |
|
32 | + { |
|
33 | + } |
|
34 | 34 | |
35 | 35 | |
36 | 36 | |
37 | - /** |
|
38 | - * @deprecated 4.9.27 |
|
39 | - * @param WP $WP |
|
40 | - * @return void |
|
41 | - */ |
|
42 | - public function run(WP $WP) |
|
43 | - { |
|
44 | - } |
|
37 | + /** |
|
38 | + * @deprecated 4.9.27 |
|
39 | + * @param WP $WP |
|
40 | + * @return void |
|
41 | + */ |
|
42 | + public function run(WP $WP) |
|
43 | + { |
|
44 | + } |
|
45 | 45 | |
46 | 46 | |
47 | 47 | |
48 | - /** |
|
49 | - * process_shortcode - ESPRESSO_CANCELLED |
|
50 | - * |
|
51 | - * @deprecated 4.9.27 |
|
52 | - * @param array $attributes |
|
53 | - * @return string |
|
54 | - * @throws \EE_Error |
|
55 | - */ |
|
56 | - public function process_shortcode($attributes = array()) |
|
57 | - { |
|
58 | - \EE_Error::doing_it_wrong( |
|
59 | - __METHOD__, |
|
60 | - __( |
|
61 | - 'Usage is deprecated. Please use \EventEspresso\core\domain\entities\shortcodes\EspressoCancelled instead.', |
|
62 | - 'event_espresso' |
|
63 | - ), |
|
64 | - '4.9.27' |
|
65 | - ); |
|
66 | - return ''; |
|
67 | - } |
|
48 | + /** |
|
49 | + * process_shortcode - ESPRESSO_CANCELLED |
|
50 | + * |
|
51 | + * @deprecated 4.9.27 |
|
52 | + * @param array $attributes |
|
53 | + * @return string |
|
54 | + * @throws \EE_Error |
|
55 | + */ |
|
56 | + public function process_shortcode($attributes = array()) |
|
57 | + { |
|
58 | + \EE_Error::doing_it_wrong( |
|
59 | + __METHOD__, |
|
60 | + __( |
|
61 | + 'Usage is deprecated. Please use \EventEspresso\core\domain\entities\shortcodes\EspressoCancelled instead.', |
|
62 | + 'event_espresso' |
|
63 | + ), |
|
64 | + '4.9.27' |
|
65 | + ); |
|
66 | + return ''; |
|
67 | + } |
|
68 | 68 | |
69 | 69 | } |
70 | 70 | // End of file EES_Espresso_Cancelled.shortcode.php |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | class EES_Espresso_Ticket_Selector extends EES_Shortcode { |
11 | 11 | |
12 | 12 | /** |
13 | - * @deprecated 4.9.27 |
|
14 | - * @return void |
|
13 | + * @deprecated 4.9.27 |
|
14 | + * @return void |
|
15 | 15 | */ |
16 | 16 | public static function set_hooks() { |
17 | 17 | } |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | |
20 | 20 | |
21 | 21 | /** |
22 | - * @deprecated 4.9.27 |
|
23 | - * @return void |
|
22 | + * @deprecated 4.9.27 |
|
23 | + * @return void |
|
24 | 24 | */ |
25 | 25 | public static function set_hooks_admin() { |
26 | 26 | } |
@@ -28,29 +28,29 @@ discard block |
||
28 | 28 | |
29 | 29 | |
30 | 30 | /** |
31 | - * @deprecated 4.9.27 |
|
32 | - * @param \WP $WP |
|
31 | + * @deprecated 4.9.27 |
|
32 | + * @param \WP $WP |
|
33 | 33 | */ |
34 | 34 | public function run( WP $WP ) { |
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | /** |
39 | - * @deprecated 4.9.27 |
|
40 | - * @param array $attributes |
|
39 | + * @deprecated 4.9.27 |
|
40 | + * @param array $attributes |
|
41 | 41 | * @return string |
42 | 42 | */ |
43 | 43 | public function process_shortcode( $attributes = array() ) { |
44 | - \EE_Error::doing_it_wrong( |
|
45 | - __METHOD__, |
|
46 | - __( |
|
47 | - 'Usage is deprecated. Please use \EventEspresso\core\domain\entities\shortcodes\EspressoTicketSelector instead.', |
|
48 | - 'event_espresso' |
|
49 | - ), |
|
50 | - '4.9.27' |
|
51 | - ); |
|
52 | - return ''; |
|
53 | - } |
|
44 | + \EE_Error::doing_it_wrong( |
|
45 | + __METHOD__, |
|
46 | + __( |
|
47 | + 'Usage is deprecated. Please use \EventEspresso\core\domain\entities\shortcodes\EspressoTicketSelector instead.', |
|
48 | + 'event_espresso' |
|
49 | + ), |
|
50 | + '4.9.27' |
|
51 | + ); |
|
52 | + return ''; |
|
53 | + } |
|
54 | 54 | |
55 | 55 | } |
56 | 56 | // End of file EES_Espresso_Ticket_Selector.shortcode.php |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @deprecated 4.9.27 |
32 | 32 | * @param \WP $WP |
33 | 33 | */ |
34 | - public function run( WP $WP ) { |
|
34 | + public function run(WP $WP) { |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @param array $attributes |
41 | 41 | * @return string |
42 | 42 | */ |
43 | - public function process_shortcode( $attributes = array() ) { |
|
43 | + public function process_shortcode($attributes = array()) { |
|
44 | 44 | \EE_Error::doing_it_wrong( |
45 | 45 | __METHOD__, |
46 | 46 | __( |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * EES_Espresso_Ticket_Selector |
4 | 6 | * |
@@ -6,7 +6,6 @@ discard block |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage /shortcodes/ |
8 | 8 | * @author Brent Christensen |
9 | - |
|
10 | 9 | * ------------------------------------------------------------------------ |
11 | 10 | */ |
12 | 11 | class EES_Espresso_Checkout extends EES_Shortcode { |
@@ -31,15 +30,15 @@ discard block |
||
31 | 30 | |
32 | 31 | |
33 | 32 | |
34 | - /** |
|
35 | - * run - initial shortcode module setup called during "wp_loaded" hook |
|
36 | - * this method is primarily used for loading resources that will be required by the shortcode when it is actually processed |
|
37 | - * |
|
38 | - * @access public |
|
39 | - * @param WP $WP |
|
40 | - * @return void |
|
41 | - * @throws \EE_Error |
|
42 | - */ |
|
33 | + /** |
|
34 | + * run - initial shortcode module setup called during "wp_loaded" hook |
|
35 | + * this method is primarily used for loading resources that will be required by the shortcode when it is actually processed |
|
36 | + * |
|
37 | + * @access public |
|
38 | + * @param WP $WP |
|
39 | + * @return void |
|
40 | + * @throws \EE_Error |
|
41 | + */ |
|
43 | 42 | public function run( WP $WP ) { |
44 | 43 | } |
45 | 44 | |
@@ -53,16 +52,16 @@ discard block |
||
53 | 52 | * @return string |
54 | 53 | */ |
55 | 54 | public function process_shortcode( $attributes = array() ) { |
56 | - \EE_Error::doing_it_wrong( |
|
57 | - __METHOD__, |
|
58 | - __( |
|
59 | - 'Usage is deprecated. Please use \EventEspresso\core\domain\entities\shortcodes\EspressoCheckout::processShortcode() instead.', |
|
60 | - 'event_espresso' |
|
61 | - ), |
|
62 | - '4.9.27' |
|
63 | - ); |
|
64 | - return ''; |
|
65 | - } |
|
55 | + \EE_Error::doing_it_wrong( |
|
56 | + __METHOD__, |
|
57 | + __( |
|
58 | + 'Usage is deprecated. Please use \EventEspresso\core\domain\entities\shortcodes\EspressoCheckout::processShortcode() instead.', |
|
59 | + 'event_espresso' |
|
60 | + ), |
|
61 | + '4.9.27' |
|
62 | + ); |
|
63 | + return ''; |
|
64 | + } |
|
66 | 65 | |
67 | 66 | } |
68 | 67 | // End of file EES_Espresso_Checkout.shortcode.php |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @return void |
41 | 41 | * @throws \EE_Error |
42 | 42 | */ |
43 | - public function run( WP $WP ) { |
|
43 | + public function run(WP $WP) { |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * @param array $attributes |
53 | 53 | * @return string |
54 | 54 | */ |
55 | - public function process_shortcode( $attributes = array() ) { |
|
55 | + public function process_shortcode($attributes = array()) { |
|
56 | 56 | \EE_Error::doing_it_wrong( |
57 | 57 | __METHOD__, |
58 | 58 | __( |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * EES_Espresso_Checkout |
4 | 6 | * |