If you do not like the way we name wall gallery of a user or group, you can rename it. You can either translate the plugin and specify a translation for the string ‘%s wall %s gallery’. That will be used when new wall galleries be created.
You canĀ also use code to modify it in a better flexible way.
Example 1:- Changing ‘Wall gallery’ to ‘Profile Gallery’
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | /** * Filter wall gallery title * * @param string $title name of the wall gallery. * @param array $args { * Context details. * @type string $component component name(e.g groups|members|sitewide) * @type int $component_id numeric component id( e.g group id or user id based on the component) * @type string $type media type(e.g photo, video,audio, doc etc) * * } * * @return string new title */ function mpp_custom_wall_gallery_name( $title, $args ) { // Profile photo gallery etc. // Profile video gallery etc. return sprintf( 'Profile %s gallery', strtolower( mpp_get_type_singular_name( $args['type'] ) ) ); } add_filter( 'mpp_wall_gallery_title', 'mpp_custom_wall_gallery_name', 10, 2 ); |
Example 2:- Include user’s name in the gallery
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | /** * Filter wall gallery title to include user's display name in it. * * @param string $title name of the wall gallery. * @param array $args { * Context details. * @type string $component component name(e.g groups|members|sitewide) * @type int $component_id numeric component id( e.g group id or user id based on the component) * @type string $type media type(e.g photo, video,audio, doc etc) * * } * * @return string new title */ function mpp_custom_wall_gallery_name_with_user_displayname( $title, $args ) { // The names be like // Tom's photo gallery // Eric's video gallery and so on. if ( 'members' === $args['component'] ) { $title = sprintf( "%s's wall %s gallery", bp_core_get_user_displayname( $args['component_id'] )->name, strtolower( mpp_get_type_singular_name( $args['type'] ) ) ); } return $title; } add_filter( 'mpp_wall_gallery_title', 'mpp_custom_wall_gallery_name_with_user_displayname', 10, 2 ); |
Example 3:- Include group’s name in the group wall gallery title.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | /** * Filter wall gallery title * * @param string $title name of the wall gallery. * @param array $args { * Context details. * @type string $component component name(e.g groups|members|sitewide) * @type int $component_id numeric component id( e.g group id or user id based on the component) * @type string $type media type(e.g photo, video,audio, doc etc) * * } * * @return string new title */ function mpp_custom_wall_gallery_name_with_group_name( $title, $args ) { // in this example, we are going to change the title for the groups wall gallery like this // <group name> wall gallery. if ( 'groups' === $args['component'] ) { $title = sprintf( '%s wall %s gallery', groups_get_group( $args['component_id'] )->name, strtolower( mpp_get_type_singular_name( $args['type'] ) ) ); } return $title; } add_filter( 'mpp_wall_gallery_title', 'mpp_custom_wall_gallery_name_with_group_name', 10, 2 ); |
Example 4:- Name wall gallery to include user or group name:-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | /** * Filter wall gallery title * * @param string $title name of the wall gallery. * @param array $args { * Context details. * * @type string $component component name(e.g groups|members|sitewide) * @type int $component_id numeric component id( e.g group id or user id based on the component) * @type string $type media type(e.g photo, video,audio, doc etc) * * } * * @return string new title */ function mpp_custom_wall_gallery_custom_name( $title, $args ) { // in this example, we are going to change the title for the groups wall gallery like this // <group name> wall <type> gallery. //<display name>'s wall <type> gallery if ( 'groups' === $args['component'] ) { $title = sprintf( '%s wall %s gallery', groups_get_group( $args['component_id'] )->name, strtolower( mpp_get_type_singular_name( $args['type'] ) ) ); } elseif ( 'members' === $args['component'] ) { $title = sprintf( "%s's wall %s gallery", bp_core_get_user_displayname( $args['component_id'] )->name, strtolower( mpp_get_type_singular_name( $args['type'] ) ) ); } return $title; } add_filter( 'mpp_wall_gallery_title', 'mpp_custom_wall_gallery_custom_name', 10, 2 ); |
Please feel free to adapt.