Making WordPress.org

Changeset 5096


Ignore:
Timestamp:
03/06/2017 03:28:19 PM (8 years ago)
Author:
SergeyBiryukov
Message:

Support Forums: Set base argument for pagination links on user's reviews page.

See #2007.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-support-compat.php

    r5089 r5096  
    4141            add_action( 'parse_query',                     array( $this, 'parse_user_reviews_query' ) );
    4242            add_filter( 'bbp_after_has_topics_parse_args', array( $this, 'parse_user_reviews_query_args' ) );
     43            add_filter( 'bbp_topic_pagination',            array( $this, 'parse_user_reviews_pagination_args' ) );
    4344            add_filter( 'bbp_before_title_parse_args',     array( $this, 'parse_user_reviews_title_args' ) );
    4445
     
    239240
    240241    /**
     242     * Set 'base' argument for pagination links on user's reviews page.
     243     *
     244     * @param array $args Pagination arguments.
     245     * @return array Filtered pagination arguments.
     246     */
     247    public function parse_user_reviews_pagination_args( $args ) {
     248        if ( get_query_var( 'wporg_single_user_reviews' ) ) {
     249            $args['base']  = bbp_get_user_profile_url( bbp_get_displayed_user_id() ) . 'reviews/';
     250            $args['base'] .= bbp_get_paged_slug() . '/%#%/';
     251        }
     252
     253        return $args;
     254    }
     255
     256    /**
    241257     * Set title for user's reviews page.
    242258     *
Note: See TracChangeset for help on using the changeset viewer.