Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/03/2023 06:18:23 AM (4 years 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/classes/class-bp-admin.php

    r13450 r13468  
    147147                require $this->admin_dir . 'bp-core-admin-functions.php';
    148148                require $this->admin_dir . 'bp-core-admin-components.php';
    149                 require $this->admin_dir . 'bp-core-admin-rewrites.php';
    150149                require $this->admin_dir . 'bp-core-admin-tools.php';
    151150                require $this->admin_dir . 'bp-core-admin-optouts.php';
     151
     152                if ( 'rewrites' === bp_core_get_query_parser() ) {
     153                        require $this->admin_dir . 'bp-core-admin-rewrites.php';
     154                }
    152155        }
    153156
    … …  
    276279                $hooks[]                                          = $bp_components_page;
    277280
    278                 $bp_rewrite_settings_page = add_submenu_page(
    279                         $this->settings_page,
    280                         __( 'BuddyPress URLs', 'buddypress' ),
    281                         __( 'BuddyPress URLs', 'buddypress' ),
    282                         $this->capability,
    283                         'bp-rewrites',
    284                         'bp_core_admin_rewrites_settings'
    285                 );
    286 
    287                 $this->submenu_pages['settings']['bp-rewrites'] = $bp_rewrite_settings_page;
    288                 $hooks[]                                        = $bp_rewrite_settings_page;
     281                if ( 'rewrites' === bp_core_get_query_parser() ) {
     282                        $bp_rewrites_settings_page = add_submenu_page(
     283                                $this->settings_page,
     284                                __( 'BuddyPress URLs', 'buddypress' ),
     285                                __( 'BuddyPress URLs', 'buddypress' ),
     286                                $this->capability,
     287                                'bp-rewrites',
     288                                'bp_core_admin_rewrites_settings'
     289                        );
     290
     291                        $this->submenu_pages['settings']['bp-rewrites'] = $bp_rewrites_settings_page;
     292                        $hooks[]                                        = $bp_rewrites_settings_page;
     293                }
    289294
    290295                $bp_settings_page = add_submenu_page(
Note: See TracChangeset for help on using the changeset viewer.