Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change text strings on plugin activation


  • jolom
    Participant

    @jolom

    Hi,

    Is there a way to change certain text parts of BuddyPress on plugin activation?

    Example, I want to use BuddyPress Announce Gruop and when the plugin is active on that group change the text Group to something else like “Join Group” to “Join Updates”

    Thanks a lot.

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

  • Venutius
    Moderator

    @venutius

    Looking at it this would be a none trivial task, you’d need to replicate and modify the BP functions that create the button to include a check to see if the group is an announcement group and change the text accordingly. Possibly a simpler alternative would be to do some hacky Javascript that replaced the text on the fly, that would need to be specific to your site config.

    Also, that plugin has not been updated in 6 years and it’s throwing errors so you’d need to fix those as well:

    1. renaming of forums menu item to announcements no longer works.
    2. Group directory additional text intefere’s with modern directory listings and I think should simply be removed.

    So there’s quite a bit of work required on that.


    jolom
    Participant

    @jolom

    Thanks @Venutius, I was watching the plugin’s code and it is very simple, also saw that errors but are easy to fix.

    Maybe changing text the way it does in this part?

    52	// change the name of the group if it's an announce group
    53	function ag_filter_group_type( $type ) {
    54	        if ( ag_get_announce_group() == 'announce' ) {
    55	                if ($type == 'Public Group')
    56	                        $type = __('Announce Group', 'announce_group' );
    57	                elseif ($type == 'Private Group')
    58	                        $type = __('Private Announce Group', 'announce_group' );
    59	                elseif ($type == 'Hidden Group')
    60	                        $type = __('Hidden Announce Group', 'announce_group' );
    61	        }
    62	        return $type;
    63	}
    64	add_filter( 'bp_get_group_type', 'ag_filter_group_type', 1 );

    But I need to change on every portion that renders “Group” right?

    Thank you.

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