Skip to content

Conversation

@imath
Copy link
Contributor

@imath imath commented Apr 23, 2023

  • Introduces bp_core_setup_query_parser() to decide when to postpone some key hooks firing to bp_parse_query.
  • Introduces bp_core_get_query_parser() to get the query parser in use. It contains a filter BP Classic will be able to use to force the Legacy URL parser. So far it uses legacy for pretty links and rewrites for plain links.
  • Edit bp_redirect_canonical() & bp_get_canonical_url() so that they use the BP Rewrites API.
  • Introduces bp_core_set_ajax_uri_globals() to set the BuddyPress URI globales using the BP Rewrites API inside the Ajax context thanks to the updated bp_reset_query() function.
  • To avoid using WP() at each Ajax call, introduces a simple Ajax actions registration process thanks to the new bp_ajax_register_action().
  • Update Legacy & Nouveau template packs so that they use this logic. As BP Default will require the legacy URL parser and will be moved inside BP Classic, the theme can stay the way it is.
  • Improve the bp_rewrites_pre_get_slug filter logic making it depends on the bp_core_get_query_parser() function.
  • Make sure to reset the Members navigation to a new BP_Core_Nav based on the displayed user once the user is available in the components parse_query() method.

Trac ticket: https://buddypress.trac.wordpress.org/ticket/4954


This Pull Request is for code review only. Please keep all other discussion in the BuddyPress Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the WordPress Core Handbook for more details.

imath and others added 5 commits April 22, 2023 09:57
Replace `bp_core_get_key_actions_hook()` by `bp_core_get_query_parser()` to make this function more usable.

Use this new function to decide whether we should use the `bp_parse_query` hook.

Fix some unit tests.

Reset the `BP_Core_Nav` inside the `BP_Members_Component::parse_query()` method when the displayed user is set.
Make it depends on the query parser in use
@imath imath deleted the patch/4954-18 branch April 24, 2023 02:35
dcavins pushed a commit to dcavins/buddypress-wp-svn that referenced this pull request Jul 28, 2023
- Introduces `bp_core_setup_query_parser()` to decide when to postpone some key hooks firing to `bp_parse_query`.
- Introduces `bp_core_get_query_parser()` to get the query parser in use. It contains a filter BP Classic will be able to use to force the Legacy URL parser. So far it uses legacy for pretty links and rewrites for plain links.
- Edit `bp_redirect_canonical()` & `bp_get_canonical_url()` so that they use the BP Rewrites API.
- Introduces `bp_core_set_ajax_uri_globals()` to set the BuddyPress URI globales using the BP Rewrites API inside the Ajax context thanks to the updated `bp_reset_query()` function.
- To avoid using `WP()` at each Ajax call, introduces a simple Ajax actions registration process thanks to the new `bp_ajax_register_action()`.
- Update Legacy & Nouveau template packs so that they use this logic. As BP Default will require the legacy URL parser and will be moved inside BP Classic, the theme can stay the way it is.
- Improve the `bp_rewrites_pre_get_slug` filter logic making it depends on the `bp_core_get_query_parser()` function.
- Make sure to reset the Members navigation to a new `BP_Core_Nav` based on the displayed user once the user is available in the component's `parse_query()` method.

Props r-a-y, johnjamesjacoby, boonebgorges

Closes buddypress/buddypress#91
See #4954



git-svn-id: http://buddypress.svn.wordpress.org/trunk@13461 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
emaralive pushed a commit to emaralive/omt-buddypress-sync that referenced this pull request Nov 2, 2025
- Introduces `bp_core_setup_query_parser()` to decide when to postpone some key hooks firing to `bp_parse_query`.
- Introduces `bp_core_get_query_parser()` to get the query parser in use. It contains a filter BP Classic will be able to use to force the Legacy URL parser. So far it uses legacy for pretty links and rewrites for plain links.
- Edit `bp_redirect_canonical()` & `bp_get_canonical_url()` so that they use the BP Rewrites API.
- Introduces `bp_core_set_ajax_uri_globals()` to set the BuddyPress URI globales using the BP Rewrites API inside the Ajax context thanks to the updated `bp_reset_query()` function.
- To avoid using `WP()` at each Ajax call, introduces a simple Ajax actions registration process thanks to the new `bp_ajax_register_action()`.
- Update Legacy & Nouveau template packs so that they use this logic. As BP Default will require the legacy URL parser and will be moved inside BP Classic, the theme can stay the way it is.
- Improve the `bp_rewrites_pre_get_slug` filter logic making it depends on the `bp_core_get_query_parser()` function.
- Make sure to reset the Members navigation to a new `BP_Core_Nav` based on the displayed user once the user is available in the component's `parse_query()` method.

Props r-a-y, johnjamesjacoby, boonebgorges

Closes buddypress/buddypress#91
See #4954



git-svn-id: https://buddypress.svn.wordpress.org/trunk@13461 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
emaralive pushed a commit to emaralive/buddypress-sync that referenced this pull request Nov 3, 2025
- Introduces `bp_core_setup_query_parser()` to decide when to postpone some key hooks firing to `bp_parse_query`.
- Introduces `bp_core_get_query_parser()` to get the query parser in use. It contains a filter BP Classic will be able to use to force the Legacy URL parser. So far it uses legacy for pretty links and rewrites for plain links.
- Edit `bp_redirect_canonical()` & `bp_get_canonical_url()` so that they use the BP Rewrites API.
- Introduces `bp_core_set_ajax_uri_globals()` to set the BuddyPress URI globales using the BP Rewrites API inside the Ajax context thanks to the updated `bp_reset_query()` function.
- To avoid using `WP()` at each Ajax call, introduces a simple Ajax actions registration process thanks to the new `bp_ajax_register_action()`.
- Update Legacy & Nouveau template packs so that they use this logic. As BP Default will require the legacy URL parser and will be moved inside BP Classic, the theme can stay the way it is.
- Improve the `bp_rewrites_pre_get_slug` filter logic making it depends on the `bp_core_get_query_parser()` function.
- Make sure to reset the Members navigation to a new `BP_Core_Nav` based on the displayed user once the user is available in the component's `parse_query()` method.

Props r-a-y, johnjamesjacoby, boonebgorges

Closes buddypress/buddypress#91
See #4954



git-svn-id: https://buddypress.svn.wordpress.org/trunk@13461 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant