• Resolved vinaykhatri1

    (@vinaykhatri1)


    I want to show username or user’s firstname and last name in place of Widget text (logged in).

    Is it possible to do this so?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author SysBasics

    (@phppoet)

    its not possible yet .

    I will consider adding it for future updates.

    Plugin Author SysBasics

    (@phppoet)

    in case you are still looking for solution.

    yes. First make sure you have version 2.5.11 or higher then you can use below given hook to modify default text

    add_filter('wcmamtx_my_account_nav_widget_text','wcmamtx_my_account_nav_widget_text_function',10,1);

    function wcmamtx_my_account_nav_widget_text_function($default_text) {

    if ( !is_user_logged_in() ) {
    return $default_text;
    }

    $current_user = wp_get_current_user();

    $user_name= $current_user->display_name;
    $default_text = 'Hello , '.ucfirst($user_name).'';
    return $default_text;
    }

    use above give php code snippet . you may use code snippets plugin to inject any extra php code.

    Best Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.