Changeset 13461 for trunk/src/bp-core/bp-core-functions.php
- Timestamp:
- 04/24/2023 02:32:27 AM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-functions.php
r13455 r13461 141 141 142 142 /** Functions *****************************************************************/ 143 144 /** 145 * Get the BuddyPress parser in use. 146 * 147 * @since 12.0.0 148 * 149 * @return string The name of the parser in use. 150 */ 151 function bp_core_get_query_parser() { 152 /** 153 * Which parser is in use? `rewrites` or `legacy`? 154 * 155 * @todo Remove the Pretty URLs check used during BP Rewrites merge process. 156 * 157 * @since 12.0.0 158 * 159 * @param string $parser The parser to use to decide the hook to attach key actions to. 160 * Possible values are `rewrites` or `legacy`. 161 */ 162 return apply_filters( 'bp_core_get_query_parser', bp_has_pretty_urls() ? 'legacy' : 'rewrites' ); 163 } 143 164 144 165 /** … … 2588 2609 bp_core_redirect( apply_filters( 'bp_core_search_site', home_url( $slug . $query_string . urlencode( $search_terms ) ), $search_terms ) ); 2589 2610 } 2590 add_action( 'bp_parse_query', 'bp_core_action_search_site', 13, 0 );2591 2611 2592 2612 /** … … 2607 2627 remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10 ); 2608 2628 } 2609 add_action( 'bp_init', 'bp_remove_adjacent_posts_rel_link' );2610 2629 2611 2630 /** … … 2979 2998 */ 2980 2999 return apply_filters( 'bp_core_get_suggestions', $retval, $args ); 3000 } 3001 3002 /** 3003 * Register Ajax actions needing the BP URI globals to be set. 3004 * 3005 * @since 12.0.0 3006 * 3007 * @param string $ajax_action The ajax action needing the BP URI globals to be set. 3008 * @return boolean True if the ajax action was registered. False otherwise. 3009 */ 3010 function bp_ajax_register_action( $ajax_action = '' ) { 3011 // Checks the ajax action is registered. 3012 if ( bp_ajax_action_is_registered( $ajax_action ) ) { 3013 return false; 3014 } 3015 3016 buddypress()->ajax_actions[] = $ajax_action; 3017 return true; 3018 } 3019 3020 /** 3021 * Is the requested ajax action registered? 3022 * 3023 * @since 12.0.0 3024 * 3025 * @param string $ajax_action The ajax action to check. 3026 * @return boolean True if the ajax action is registered. False otherwise 3027 */ 3028 function bp_ajax_action_is_registered( $ajax_action = '' ) { 3029 $registered_ajax_actions = buddypress()->ajax_actions; 3030 3031 return in_array( $ajax_action, $registered_ajax_actions, true ); 2981 3032 } 2982 3033
Note: See TracChangeset
for help on using the changeset viewer.