Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/03/2023 06:18:23 AM (17 months ago)
Author:
imath
Message:

Stop using BP Legacy URL parser in favor of the new BP Rewrites API

  • Deprecate bp_core_set_uri_globals(). This function is moved inside the BP Classic compatibility plugin.
  • Introduce the new bp_register_nav action to hook to when globalizing Members single item navigations from the BP_Component class.
  • Improve bp_get_component_navigations() so that Avatar/Cover images navigation items are moved inside the Profile sub nav if the Extended profile component is active.
  • Register Avatar/Cover images Ajax actions so that these actions trigger our new URL Parser inside Ajax context.
  • Improve the BP_Core_Nav::add_nav() method so that any BP action variable slugs can be customized.
  • Improve Members & Groups component canonical redirections.
  • Handle slugs customization persistency using directory pages post metas.
  • Introduce a new repair tool to reset all slugs to BuddyPress default one.
  • Adapt some PHPUnit tests to better handle our new URL parser.

Props Props r-a-y, johnjamesjacoby, boonebgorges

Closes https://github.com/buddypress/buddypress/pull/94
See #4954

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/deprecated/12.0.php

    r13449 r13468  
    1414// These functions has been moved to the BP Classic plugin.
    1515if ( ! function_exists( 'bp_classic' ) ) {
     16    /**
     17     * Analyze the URI and break it down into BuddyPress-usable chunks.
     18     *
     19     * BuddyPress can use complete custom friendly URIs without the user having to
     20     * add new rewrite rules. Custom components are able to use their own custom
     21     * URI structures with very little work.
     22     *
     23     * The URIs are broken down as follows:
     24     *   - http:// example.com / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
     25     *   - OUTSIDE ROOT: http:// example.com / sites / buddypress / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
     26     *
     27     * Example:
     28     *    - http://example.com/members/andy/profile/edit/group/5/
     29     *    - $bp->current_component: string 'xprofile'
     30     *    - $bp->current_action: string 'edit'
     31     *    - $bp->action_variables: array ['group', 5]
     32     *
     33     * @since 1.0.0
     34     * @deprecated 12.0.0
     35     */
     36    function bp_core_set_uri_globals() {
     37        _deprecated_function( __FUNCTION__, '12.0.0' );
     38    }
     39
    1640    /**
    1741     * Add support for a top-level ("root") component.
Note: See TracChangeset for help on using the changeset viewer.