Skip to:
Content
Pages
Categories
Search
Top
Bottom

Cannot redeclare bp_get_groups_pagination_count()

  • @fourmi

    Participant

    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)
  • @shanebp

    Moderator

    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.
    https://codex.wordpress.org/Pluggable_Functions

    @fourmi

    Participant

    It’s so simple! Thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Cannot redeclare bp_get_groups_pagination_count()’ is closed to new replies.
Skip to toolbar