BuddyDev

Search

[Resolved] Where to change BP Text for activity update

  • Participant
    Level: Master
    Posts: 497
    Daniel on #31753

    Hi,

    I would like to change the BP text inside the text field which says: “What’s new, [name of user]. But I don’t wanna use po-edit.

    This might be hard coded, could you please tell me in which php file this text is coded in order that I can go inside and amend the text? Would it be possible to save then the file inside my child theme in order that the text remains as it is in case of future updates?

    Thanks for your input.

    Regards
    Daniel

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #31777

    Hi Daniel,
    Thank you for the question.

    If you do not want to use translation, you will need to override template if using legacy template pack.

    Please copy parent-theme/buddypress/activity/post-form.php (if not present, you will need to copy it from plugin/buddypress/bp-templates/bp-legacy /buddypress/activity/post-form.php

    If you are using BP Nouveau, the above method will not work.

    you can use the following code in bp-custom.php or functions.php of your theme

    
    
    add_filter( 'bp_core_get_js_strings', function ( $params ) {
    
    	if ( ! isset( $params['activity'] ) || ! isset( $params['activity']['strings'] ) ) {
    		return $params;
    	}
    
    	$params['activity']['strings']['whatsnewPlaceholder'] = sprintf( __( "Hello, What's new, %s?", 'buddypress' ), bp_get_user_firstname( bp_get_loggedin_user_fullname() ) );
    
    	return $params;
    }, 100 );
    
    

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 497
    Daniel on #31904

    Hi Brajesh,

    Have tested the code and it’s working.

    Thank you and have a nice evening :)🎢

    Regards
    Daniel

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #31916

    Hi Daniel,
    Thank you for confirming.

    Regards
    Brajesh

The topic ‘ [Resolved] Where to change BP Text for activity update’ is closed to new replies.

This topic is: resolved