Changeset 13461 for trunk/src/bp-core/bp-core-actions.php
- Timestamp:
- 04/24/2023 02:32:27 AM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-actions.php
r13431 r13461 72 72 add_action( 'bp_init', 'bp_register_post_statuses', 2 ); 73 73 add_action( 'bp_init', 'bp_register_taxonomies', 2 ); 74 add_action( 'bp_init', 'bp_core_set_uri_globals', 2 );75 74 add_action( 'bp_init', 'bp_setup_globals', 4 ); 76 add_action( 'bp_init', 'bp_setup_canonical_stack', 5 );77 add_action( 'bp_init', 'bp_setup_nav', 6 );78 add_action( 'bp_init', 'bp_setup_title', 8 );79 75 add_action( 'bp_init', 'bp_blocks_init', 10 ); 80 76 add_action( 'bp_init', 'bp_core_load_admin_bar_css', 12 ); … … 82 78 add_action( 'bp_init', 'bp_add_rewrite_rules', 30 ); 83 79 add_action( 'bp_init', 'bp_add_permastructs', 40 ); 80 81 /** 82 * Adapt BuddyPress key actions starting point according to the request parser in use. 83 * 84 * The legacy request parser needs key actions to hook at `bp_init`, while the BP Rewrites API 85 * needs key actions to hook at `bp_parse_query`. 86 * 87 * @since 12.0.0 88 */ 89 function bp_core_setup_query_parser() { 90 $parser = bp_core_get_query_parser(); 91 $hook = 'bp_parse_query'; 92 if ( 'legacy' === $parser ) { 93 $hook = 'bp_init'; 94 } 95 96 $key_actions = array( 97 'bp_setup_canonical_stack' => 11, 98 'bp_setup_nav' => 12, 99 'bp_core_action_search_site' => 13, 100 'bp_setup_title' => 14, 101 '_bp_maybe_remove_redirect_canonical' => 20, 102 'bp_remove_adjacent_posts_rel_link' => 20, 103 ); 104 105 if ( 'bp_init' === $hook ) { 106 $key_actions['bp_setup_canonical_stack'] = 5; 107 $key_actions['bp_setup_nav'] = 6; 108 $key_actions['bp_core_action_search_site'] = 7; 109 $key_actions['bp_setup_title'] = 8; 110 $key_actions['_bp_maybe_remove_redirect_canonical'] = 10; 111 $key_actions['bp_remove_adjacent_posts_rel_link'] = 10; 112 113 /** 114 * 115 * @todo This code should be moved to BP Classic. 116 * 117 */ 118 add_action( $hook, 'bp_core_set_uri_globals', 2 ); 119 } 120 121 foreach ( $key_actions as $action => $priority ) { 122 $arguments = 1; 123 124 if ( 'bp_core_action_search_site' === $action ) { 125 $arguments = 0; 126 } 127 128 add_action( $hook, $action, $priority, $arguments ); 129 } 130 } 131 add_action( 'bp_init', 'bp_core_setup_query_parser', 1 ); 84 132 85 133 /**
Note: See TracChangeset
for help on using the changeset viewer.