Skip to:
Content
Pages
Categories
Search
Top
Bottom

Looking for a way to override the pagination system

  • @frenchwebmaster

    Participant

    Hello there,

    I’m trying to find a way to override the pagination system for members and groups. My idea is to create a new plugin which allows to hide the pagination for non logged users.
    I definitely don’t want to do it in my template code but in an external plugin. I think I have to override the bp_get_group_member_pagination (and those for the groups too) in my plugin but I really don’t know how to do that.

    May someone can help me on this point,

    Thanks you !

Viewing 6 replies - 1 through 6 (of 6 total)
  • @chouf1

    Participant

    @frenchwebmaster

    Participant

    Thank you for the links !

    My point is I want to override the method bp_groups_pagination_links which is in plugins/buddypress/bp-groups/bp-groups-template.php, I created a plugin in which I rewrite the function but when I try to access to my buddypress It says : “Fatal error: Cannot redeclare bp_groups_pagination_links() (previously declared in … ”

    How can I do ?

    Thanks

    @modemlooper

    Moderator

    function bp_remove_pagination() {

    If ( ! is_user_logged_in() )
    return false;
    }
    add_filter( ‘bp_get_groups_pagination_links’, ‘bp_remove_pagination’ );

    @chouf1

    Participant

    you can’t redefine a function which i already declared. This means you have to change the name of the custom function.

    @chouf1

    Participant

    is_user_logged_in  will work better

    @frenchwebmaster

    Participant

    Thanks a lot, it works perfectly with :

    function bp_remove_pagination() {

    If ( ! is_user_logged_in() )
    return false;
    }
    add_filter( ‘bp_get_groups_pagination_links’, ‘bp_remove_pagination’ );

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Looking for a way to override the pagination system’ is closed to new replies.
Skip to toolbar