Skip to:
Content
Pages
Categories
Search
Top
Bottom

Override class function inside bbpress/includes/extend/buddypress/activity.php

  • @techinfancy

    Participant

    Hi,

    i am looking to change a line of code, line 421 of bbpress/includes/extend/buddypress/activity.php from

    $activity_text = sprintf( esc_html__( ‘%1$s started the topic %2$s in the forum %3$s’, ‘bbpress’ ), $user_link, $topic_link, $forum_link );

    to

    $activity_text = sprintf( esc_html__( ‘%1$s created the post %2$s in %3$s’, ‘bbpress’ ), $user_link, $topic_link, $forum_link );

    i am unsure of how i can edit this function inside my child-theme, i have attempted to recreate the directory structure with no luck, and do not want to particularly edit the plugin folder for obvious reasons.

    I am rather new to wordpress development etc, so any help would be appreciated.

    Cheers,
    Shaun.

Viewing 4 replies - 1 through 4 (of 4 total)
  • @venutius

    Moderator

    Couldn’t you just change that via translation?

    @techinfancy

    Participant

    can you please elaborate? have not heard of translation before.

    @venutius

    Moderator

    the line esc_html__( ‘%1$s started the topic %2$s in the forum %3$s’, ‘bbpress’ ) presents the phrse “started the topic in the forum” to WP translation as part of the bbpress translation component. This means that you can create you own translation (alternative text) for the bbpress string using poedit and maybe WPT Custom MO File in order to get your system to use your translation for your site.

    See https://codex.buddypress.org/translations/ and https://codex.buddypress.org/getting-started/customizing/customizing-labels-messages-and-urls/ obviously these pages are for BuddyPress, not bbPress but it’s the same principle.

    @techinfancy

    Participant

    i will look into this, thank you very much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Override class function inside bbpress/includes/extend/buddypress/activity.php’ is closed to new replies.
Skip to toolbar