Hi
I want to edit the woodmart_get_header_links function so I can change the username label.
I used the woodmart_get_header_links filter to do this, but it doesn’t work.
`add_filter( ‘woodmart_get_header_links’, function(){
if( is_user_logged_in() ) {
$current_user = wp_get_current_user();
if( ! empty( $current_user->user_lastname ) ){
$display_name = $current_user->user_lastname;
}elseif( ! empty( $current_user->user_firstname ) ){
$display_name = $current_user->user_firstname;
}elseif( ! empty( $current_user->display_name ) ){
$display_name = $current_user->display_name;
}else{
$display_name = ‘User Hi’;
}
$links[‘my-account’][‘label’] = sprintf( esc_html__( ‘Hello, %s’, ‘woodmart’ ), esc_html( $display_name ) );
}
return $links[‘my-account’][‘label’];
},999 );
Why?