Created
July 24, 2017 10:09
-
-
Save pranali333/6978a735e64454d5ac2050a26816b6b8 to your computer and use it in GitHub Desktop.
Change media gallery title with BuddyPress 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
/** | |
* Change title of "Media Gallery" in "media" tab. | |
* This functions needs "Buddypress" plugin to be activated. | |
* | |
* @param string $title Title of Media gallery. | |
* @return String Updated title. | |
*/ | |
function rtm_gallery_title( $title ) { | |
// Get user name for current profile. | |
if ( ! function_exists( 'bp_get_displayed_user_mentionname' ) ) { | |
return; | |
} | |
$title = '@' . bp_get_displayed_user_mentionname() . '\'s Media'; | |
return $title; | |
} | |
add_filter( 'rtmedia_gallery_title', 'rtm_gallery_title' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment