Skip to:
Content

BuddyPress.org

Changeset 7369


Ignore:
Timestamp:
09/03/2013 07:40:48 PM (10 years ago)
Author:
johnjamesjacoby
Message:

Rewrite Rules:

Add parse_query() method to BP_Component class, allowing each component to have dedicated query parsing logic. See #4954.

File:
1 edited

Legend:

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

    r7368 r7369  
    281281        add_action( 'bp_add_permastructs',       array( $this, 'add_permastructs'       ), 10 );
    282282
     283        // Allow components to parse the main query
     284        add_action( 'bp_parse_query',            array( $this, 'parse_query'            ), 10 );
     285
    283286        // Generate rewrite rules
    284287        add_action( 'bp_generate_rewrite_rules', array( $this, 'generate_rewrite_rules' ), 10 );
     
    414417
    415418    /**
     419     * Allow components to parse the main query
     420     *
     421     * @since BuddyPress (1.9)
     422     *
     423     * @uses do_action() Calls 'bp_{@link bp_Component::name}_parse_query'
     424     * @param object The main WP_Query
     425     */
     426    public function parse_query( $query ) {
     427        do_action_ref_array( 'bp_' . $this->id . '_parse_query', $query );
     428    }
     429
     430    /**
    416431     * Generate any additional rewrite rules
    417432     *
Note: See TracChangeset for help on using the changeset viewer.