Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/403dfec519f22300c6b08275ae363003 to your computer and use it in GitHub Desktop.
Save KaineLabs/403dfec519f22300c6b08275ae363003 to your computer and use it in GitHub Desktop.
Convert {displayed_username} into displayed profile username
<?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