Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/20/2023 02:30:11 AM (12 months ago)
Author:
imath
Message:

Start implementing parse_query() methods for directory components

First concerned commponents are: Activity, Blogs & Members.

  • Remove the notice used to force pretty permalinks
  • Use plain links to test parse_query() methods are rightly setting BuddyPress URI globals
  • Introduce some helper functions used during the BP Rewrites API parsing process :
    • bp_is_directory_homepage() is checking if a BP Directory is used as the site's homepage
    • bp_rewrites_get_custom_slug_rewrite_id() finds a Rewrite ID out of a custom slug.
    • bp_rewrites_get_member_data() returns the field to use to get the user by.
    • bp_reset_query() makes it possible to parse again a request in specific cases (eg: root profiles)

Props r-a-y, johnjamesjacoby, boonebgorges

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-component.php

    r13450 r13455  
    578578
    579579        // Allow components to parse the main query.
    580         add_action( 'bp_parse_query',            array( $this, 'parse_query'            ), 10 );
     580        if ( ! bp_has_pretty_urls() ) {
     581            /**
     582             * Only fire this hook when pretty links are disabled.
     583             *
     584             * @todo Remove once BP Rewrites merge process is ended.
     585             */
     586            add_action( 'bp_parse_query',  array( $this, 'parse_query' ), 10 );
     587        }
    581588
    582589        // Generate rewrite rules.
Note: See TracChangeset for help on using the changeset viewer.