Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/18/2020 02:42:53 PM (4 years ago)
Author:
imath
Message:

BP Nouveau: make sure custom components can define their pagination

Introduce a new filter bp_nouveau_pagination_params Plugin Authors can use to customize the pagination of the directory page of their custom component.

Props sbrajesh

Fixes #8280

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/includes/template-tags.php

    r12567 r12623  
    446446            $bottom_hook = '';
    447447            $page_arg    = $GLOBALS['requests_template']->pag_arg;
     448            break;
     449
     450        default:
     451            /**
     452             * Use this filter to define your custom pagination parameters.
     453             *
     454             * @since 6.0.0
     455             *
     456             * @param array $value {
     457             *     An associative array of pagination parameters.
     458             *     @type string   $pag_count Information about the pagination count.
     459             *                               eg: "Viewing 1 - 10 of 20 items".
     460             *     @type string   $pag_links The Pagination links.
     461             *     @type string   $page_arg  The argument to use to pass the page number.
     462             * }
     463             * @param string $pagination_type Information about the pagination type.
     464             */
     465            $pagination_params = apply_filters( 'bp_nouveau_pagination_params',
     466                array(
     467                    'pag_count' => '',
     468                    'pag_links' => '',
     469                    'page_arg'  => '',
     470                ),
     471                $pagination_type
     472            );
     473
     474            list( $pag_count, $pag_links, $page_arg ) = array_values( $pagination_params );
    448475            break;
    449476    }
Note: See TracChangeset for help on using the changeset viewer.