ld_focus_mode_welcome_name

apply_filters( 'ld_focus_mode_welcome_name',  string $user_nicename,  WP_User|boolean $user_data )

Filters Focus mode user welcome name.


Description #


Parameters #

$user_nicename

(string) User nice name.

$user_data

(WP_User|boolean) User Object or false if no user found.


Source #

File: themes/ld30/templates/focus/masthead.php


Examples #

 <?php
/**
 * Example usage for ld_focus_mode_welcome_name filter.
 */
add_filter(
	'ld_focus_mode_welcome_name',
	function( $user_display_name, $user_data ) {
		// Set displayed name as user first name
		if ( ( $user_data ) && ( is_a( $user_data, 'WP_User' ) ) ) {
			$user_display_name = $user_data->first_name;
		}

		// Always return $user_display_name;
		return $user_display_name;
	},
	30,
	2
);

add_filter(
	'ld_focus_mode_welcome_name',
	function( $display_name, $user_info ) {
		return $user_info->first_name;
	},
	20,
	2
);