55use EventEspresso \core \exceptions \InvalidDataTypeException ;
66use EventEspresso \core \exceptions \InvalidInterfaceException ;
77use EventEspresso \core \services \loaders \LoaderFactory ;
8+ use EventEspresso \core \services \notifications \AriaLiveAnnouncer ;
89use EventEspresso \core \services \request \CurrentPage ;
910use EventEspresso \core \services \request \sanitizers \AllowedTags ;
1011use EventEspresso \core \services \shortcodes \LegacyShortcodesManager ;
@@ -69,25 +70,26 @@ public function __construct(
6970 $ this ->Module_Request_Router = $ Module_Request_Router ;
7071 // load other resources and begin to actually run shortcodes and modules
7172 // analyse the incoming WP request
72- add_action ('parse_request ' , array ( $ this , 'get_request ' ), 1 , 1 );
73+ add_action ('parse_request ' , [ $ this , 'get_request ' ] , 1 );
7374 // process request with module factory
74- add_action ('pre_get_posts ' , array ( $ this , 'pre_get_posts ' ), 10 , 1 );
75+ add_action ('pre_get_posts ' , [ $ this , 'pre_get_posts ' ] );
7576 // before headers sent
76- add_action ('wp ' , array ( $ this , 'wp ' ) , 5 );
77+ add_action ('wp ' , [ $ this , 'wp ' ] , 5 );
7778 // primarily used to process any content shortcodes
78- add_action ('template_redirect ' , array ( $ this , 'templateRedirect ' ) , 999 );
79+ add_action ('template_redirect ' , [ $ this , 'templateRedirect ' ] , 999 );
7980 // header
80- add_action ('wp_head ' , array ( $ this , 'header_meta_tag ' ) , 5 );
81- add_action ('wp_print_scripts ' , array ( $ this , 'wp_print_scripts ' ), 10 );
82- add_filter ('template_include ' , array ( $ this , 'template_include ' ) , 1 );
81+ add_action ('wp_head ' , [ $ this , 'header_meta_tag ' ] , 5 );
82+ add_action ('wp_print_scripts ' , [ $ this , 'wp_print_scripts ' ] );
83+ add_filter ('template_include ' , [ $ this , 'template_include ' ] , 1 );
8384 // display errors
84- add_action ('loop_start ' , array ( $ this , 'display_errors ' ) , 2 );
85+ add_action ('loop_start ' , [ $ this , 'display_errors ' ] , 2 );
8586 // the content
8687 // add_filter( 'the_content', array( $this, 'the_content' ), 5, 1 );
8788 // exclude our private cpt comments
88- add_filter ('comments_clauses ' , array ($ this , 'filter_wp_comments ' ), 10 , 1 );
89- // make sure any ajax requests will respect the url schema when requests are made against admin-ajax.php (http:// or https://)
90- add_filter ('admin_url ' , array ($ this , 'maybe_force_admin_ajax_ssl ' ), 200 , 1 );
89+ add_filter ('comments_clauses ' , [$ this , 'filter_wp_comments ' ]);
90+ // make sure any ajax requests will respect the url schema
91+ // when requests are made against admin-ajax.php (http:// or https://)
92+ add_filter ('admin_url ' , [$ this , 'maybe_force_admin_ajax_ssl ' ], 200 );
9193 // action hook EE
9294 do_action ('AHEE__EE_Front_Controller__construct__done ' , $ this );
9395 }
@@ -134,7 +136,7 @@ public function getLegacyShortcodesManager()
134136 * This simply makes sure that any "private" EE CPTs do not have their comments show up in any wp comment
135137 * widgets/queries done on frontend
136138 *
137- * @param array $clauses array of comment clauses setup by WP_Comment_Query
139+ * @param array $clauses array of comment clauses setup by WP_Comment_Query
138140 * @return array array of comment clauses with modifications.
139141 * @throws InvalidArgumentException
140142 * @throws InvalidDataTypeException
@@ -148,7 +150,7 @@ public function filter_wp_comments($clauses)
148150 $ custom_post_types = LoaderFactory::getLoader ()->getShared (
149151 'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions '
150152 );
151- $ cpts = $ custom_post_types ->getPrivateCustomPostTypes ();
153+ $ cpts = $ custom_post_types ->getPrivateCustomPostTypes ();
152154 foreach ($ cpts as $ cpt => $ details ) {
153155 $ clauses ['where ' ] .= $ wpdb ->prepare (" AND $ wpdb ->posts .post_type != %s " , $ cpt );
154156 }
@@ -160,7 +162,7 @@ public function filter_wp_comments($clauses)
160162 /**
161163 * this just makes sure that if the site is using ssl that we force that for any admin ajax calls from frontend
162164 *
163- * @param string $url incoming url
165+ * @param string $url incoming url
164166 * @return string final assembled url
165167 */
166168 public function maybe_force_admin_ajax_ssl ($ url )
@@ -258,6 +260,7 @@ public function pre_get_posts($WP_Query)
258260 */
259261 public function wp ()
260262 {
263+ AriaLiveAnnouncer::setHooks ();
261264 }
262265
263266
@@ -283,8 +286,8 @@ public function templateRedirect()
283286 // if we are already loading assets then just move along, otherwise check for widgets
284287 $ load_assets = $ load_assets || $ this ->espresso_widgets_in_active_sidebars ();
285288 if ($ load_assets ) {
286- add_action ('wp_enqueue_scripts ' , array ( $ this , 'enqueueStyle ' ), 10 );
287- add_action ('wp_enqueue_scripts ' , array ( $ this , 'enqueueScripts ' ), 10 );
289+ add_action ('wp_enqueue_scripts ' , [ $ this , 'enqueueStyle ' ] );
290+ add_action ('wp_enqueue_scripts ' , [ $ this , 'enqueueScripts ' ] );
288291 }
289292
290293 if (is_singular (EspressoPostType::EVENTS )) {
@@ -304,7 +307,7 @@ public function templateRedirect()
304307 */
305308 private function espresso_widgets_in_active_sidebars ()
306309 {
307- $ espresso_widgets = array () ;
310+ $ espresso_widgets = [] ;
308311 foreach ($ this ->Registry ->widgets as $ widget_class => $ widget ) {
309312 $ id_base = EspressoWidget::getIdBase ($ widget_class );
310313 if (is_active_widget (false , false , $ id_base )) {
@@ -389,7 +392,6 @@ public function enqueueStyle()
389392 }
390393
391394
392-
393395 /*********************************************** WP_FOOTER ***********************************************/
394396
395397
@@ -425,7 +427,7 @@ public function display_errors(WP_Query $query)
425427 } else {
426428 // block enabled themes run their query loop before headers are sent
427429 // so we need to add our notices onto the beginning of the content
428- add_filter ('the_content ' , [$ this , 'prependNotices ' ], 1 , 1 );
430+ add_filter ('the_content ' , [$ this , 'prependNotices ' ], 1 );
429431 }
430432 }
431433 do_action ('AHEE__EE_Front_Controller__display_errors__end ' );
@@ -476,9 +478,9 @@ public function template_include($template_include_path = '')
476478 $ this ->_template_path = ! empty ($ this ->_template_path )
477479 ? basename ($ this ->_template_path )
478480 : basename ((string ) $ template_include_path );
479- $ template_path = EEH_Template::locate_template ($ this ->_template_path , [], false );
481+ $ template_path = EEH_Template::locate_template ($ this ->_template_path , [], false );
480482 $ this ->_template_path = ! empty ($ template_path ) ? $ template_path : $ template_include_path ;
481- $ this ->_template = basename ($ this ->_template_path );
483+ $ this ->_template = basename ($ this ->_template_path );
482484 return $ this ->_template_path ;
483485 }
484486 return $ template_include_path ;
@@ -494,7 +496,6 @@ public function get_selected_template($with_path = false)
494496 return $ with_path ? $ this ->_template_path : $ this ->_template ;
495497 }
496498
497-
498499 /**
499500 * @param string $shortcode_class
500501 * @param WP $wp
0 commit comments