Created
August 21, 2020 02:12
-
-
Save KaineLabs/403dfec519f22300c6b08275ae363003 to your computer and use it in GitHub Desktop.
Convert {displayed_username} into displayed profile username
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Convert {displayed_username} into displayed profile username. | |
*/ | |
function yzc_convert_displayed_username_for_widgets_title( $args, $widget ) { | |
if ( $widget == 'friends' || $widget == 'groups' ) { | |
$args['name'] = str_replace( '{displayed_username}', bp_core_get_username( bp_displayed_user_id() ), $args['name'] ); | |
} | |
return $args; | |
} | |
add_filter( 'yz_profile_widget_args', 'yzc_convert_displayed_username_for_widgets_title', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment