Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change the Oh bother! No topics were found here! message?

  • @joviyach

    Participant

    Forgive me if this is already out there somewhere, but I was wondering how to go about changing this message to say something else?

    Is there a front-end way to do this, or is it something in a .PHP file somewhere that needs to be edited?

    Thanks in advance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • @robkk

    Moderator

    Copy feedback-no-topics.php from bbPress’s templates and into your child theme in a folder called bbpress. Then customize the message to your liking.

    @casiepa

    Moderator

    @Robkk
    Any filter that would exist for this one ?
    Pascal.

    @robkk

    Moderator

    @casiepa

    I guess you can also use this.

    function change_translate_text( $translated_text ) {
      if ( $translated_text == ‘Oh bother! No topics were found here!’) {
        $translated_text = ‘No topics were found here!’;
      }
      return $translated_text;
    }
    add_filter( 'gettext', 'change_translate_text', 20 );

    @casiepa

    Moderator

    @joviyach

    If it can help, I have just uploaded the new version of my personal plugin https://wordpress.org/plugins/bbp-manage-subscriptions/ where you can play with the ‘Oh Bother! message (hide it, set a different text, …)
    My plugin is adapted to my own needs, but feel free to use it. And give me more ideas to implement !

    Pascal.

    @robkk

    Moderator

    @casiepa

    I am starting to think that filter may not be the best way to translate content. It was widely used though and was recommend a few times in these forums.

    The dangers of the gettext filter

    While trying to find the bbPress string swap plugin that was a bbPress plugin that use to do this exact thing fine. I came upon this that lead me to find the alternative to the gettext filter and using global $l10n;

    https://github.com/justintadlock/hybrid-core/issues/49

    Here is an example with BuddyPress and I am sure there is a way to make this kind of thing work with bbPress.

    https://bp-tricks.com/coding/string-replacement-hack-core/

    @casiepa

    Moderator

    Hi,

    Just to close it here in case somebody else would look for it, I have it implemented in bbP toolkit (https://wordpress.org/plugins/bbp-toolkit/). Still need to review Robkk last update, but for now it works.

    Pascal.

    @joviyach

    Participant

    I was able to do what was needed with Robkk’s plugin.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Skip to toolbar