Skip to:
Content
Pages
Categories
Search
Top
Bottom

Cannot redeclare bp_get_groups_pagination_count()

  • Avatar of Fourmi
    Gabrielle
    Participant

    @fourmi

    I’m trying to edit the groups pagination output. My idea was to redeclare the function bp_get_groups_pagination_count() in my bp-custom.php file but I get this error:

    Fatal error: Cannot redeclare bp_get_groups_pagination_count() in /nas/wp/www/staging/chronicles/wp-content/plugins/buddypress/bp-groups/bp-groups-template.php on line 902

    Is there a way I can redeclare this function without modifying the BuddyPress core function? Or is there another way to edit the pagination output?

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    To change the output, use the filter hook in
    bp-groups-template.php -> bp_get_groups_pagination_count()

    return apply_filters( 'bp_get_groups_pagination_count', sprintf( __( 'Viewing group %1$s to %2$s (of %3$s groups)', 'buddypress' ), $from_num, $to_num, $total ) );

    You can’t override functions unless they are pluggable.

    http://codex.wordpress.org/Pluggable_Functions

    Avatar of Fourmi
    Gabrielle
    Participant

    @fourmi

    It’s so simple! Thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.