BuddyPress Group Tags
[resolved] Change "topic" to something else? (3 posts)

  1. Jeff
    Posted 3 years ago #

    When you hover over a tag, you get a flyover like "1 topic". Is there a way to change that to something like "club" instead of "topic"? I've looked through the code and couldn't find a reference for "topic" that I could change.



  2. Jeff
    Posted 3 years ago #

    OK, so after some research, I think I figured this out. You need to add one line of code to the plugin and a few more to functions.php.

    Here's what I added into functions.php:

    function my_tag_text_callback( $count ) {
    	//This function is used to replace the "topic" with "club" for the tag cloud. When you hover mouse over a tag value, it
    	//would normally say "1 topic". Now it will say "1 club".
     return sprintf( _n('%s Club', '%s Clubs', $count), number_format_i18n( $count ) );

    Note: You could of course use "Group" and "Groups" like this:
    return sprintf( _n('%s Group', '%s Groups', $count), number_format_i18n( $count ) );

    Now, in the bp-group-tags.php file, go to line 260 and change it from this:
    'separator' => ' '

    to this:
    'separator' => ' ', //add a comma at the end

    Then on a new line just below 260 add the following:
    'topic_count_text_callback' => 'my_tag_text_callback'

    So you end up with lines 260 and 261 looking like this:

    'separator' => ' ',
      'topic_count_text_callback' => 'my_tag_text_callback'

    This change was based on the information found here:


  3. HansRuedi Keller
    Posted 3 years ago #

    Hi Jeff,

    Thanks for this. Working perfect.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • BuddyPress Group Tags
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic