• Resolved wesleypeace

    (@wesleypeace)


    The Admin Hide “Howdy” is no longer working. I’ve looked at it on two different sites and even though it’s checked, it is no longer hiding “Howdy” from the Admin bar.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Bowo

    (@qriouslad)

    It’s working fine on two of my sites. i.e. I can’t replicate the issue.

    Do you have any other plugin that is modifying the admin bar in some way?

    lookazd

    (@lookazd)

    I also have the same issue.
    Hide Howdy is checked, but it’s still there :/

    Brent

    (@colourstone)

    Same issue here at instockgems.com

    Plugin Author Bowo

    (@qriouslad)

    @wesleypeace @colourstone Another user reported this issue yesterday. So, something is definitely off.

    If you uncheck “Remove ‘Howdy'”, click “Save Changes” re-check “Remove ‘Howdy'” and “Save Changes” again on ASE settings page, do you still see ‘Howdy’ on the admin bar?

    lookazd

    (@lookazd)

    If you uncheck “Remove ‘Howdy’”, click “Save Changes” re-check “Remove ‘Howdy’” and “Save Changes” again on ASE settings page, do you still see ‘Howdy’ on the admin bar?

    Yes I tried that, but it’s still there

    Brent

    (@colourstone)

    Hi, thanks for your response. I did that, still there ??

    FYI: I just updated to WP v6.1 & also tried to add a snippet to functions, still there. Removed snippet.

    Plugin Author Bowo

    (@qriouslad)

    @everyone: I was just able to replicate the issue with the following steps:

    1. Create a fresh WP v6.5.5 installation (PHP 8.2)
    2. Install ASE, remove ‘Howdy’ successfully
    3. Update to WP v6.6.1
    4. ‘Howdy’ is showing up again.

    Seems like there’s some change in WP 6.6 that is causing this. Will investigate a fix.

    verysiberian

    (@verysiberian)

    Thanks! Same issue here with multiple sites.

    Plugin Author Bowo

    (@qriouslad)

    @everyone the issue is caused by a small change since WP v6.6 in /wp-includes/class-wp-admin-bar.php, from:

    add_action( 'admin_bar_menu', 'wp_admin_bar_my_account_item', 7 );

    to:

    add_action( 'admin_bar_menu', 'wp_admin_bar_my_account_item', 9991 );

    This will be fixed in the next release (Monday). Thanks again for reporting this.

    Brent

    (@colourstone)

    Mine already reads:
    add_action( ‘admin_bar_menu’, ‘wp_admin_bar_my_account_item’, 9991 );

    Still showing. I’ll wait for release if it’s coming Monday.

    Plugin Author Bowo

    (@qriouslad)

    @colourstone yes, that’s the code in WP core. I’ll make adjustment in ASE in the next release to compensate for that slightly changed code.

    I found an another solution, use below script:

    function as_custom_admin_bar_user_name() {
    global $wp_admin_bar;
    // Define the ID of the node representing the “My Account” section in the admin bar.
    $node_id = ‘my-account’;
    // Check if the specified node exists in the admin bar.
    if ($wp_admin_bar->get_node($node_id)) {
    // Get the current title of the “My Account” section.
    $current_title = $wp_admin_bar->get_node($node_id)->title;
    // Split the current title into an array based on the comma and space separator.
    $newTitle = explode(“, “, $current_title);
    // Update the “My Account” section title with the second part of the split title if available,
    // otherwise keep the current title.
    $wp_admin_bar->add_node(array(
    ‘id’ => $node_id,
    ‘title’ => isset($newTitle) && isset($newTitle[1]) ? $newTitle[1] : $current_title,
    ));
    }
    }
    // Hook the custom admin bar user name function to run before the admin bar is rendered.
    add_action(‘wp_before_admin_bar_render’, ‘as_custom_admin_bar_user_name’);

    Plugin Author Bowo

    (@qriouslad)

    @ankitbnl406 thanks for posting your alternative solution!

    stevegs

    (@stevegs)

    None of these suggestions so far have worked for me, though I’ve managed to sort it out based on that proposed by @ankitbnl406

    It seems that WordPress has finally realised their 19th century cowboy greeting is not favoured this side of the Atlantic. Having managed to replace it for some time, mine started greeting me with the almost as naff “Hi, {username}” as from WP 6.6.1 – I assume I don’t get “Howdy” is because I have the British (dare I say ‘proper’) English dictionary installed. (Though I note the header on this page, when logged in, still greets me with “Howdy”.)

    The following simple code in functions.php does exactly what I want – no need for a plugin:

    function replace_howdy( $wp_admin_bar ) {
    $my_account = $wp_admin_bar->get_node('my-account');
    $title = $my_account->title;
    /* Look for a comma separator in $title:
    If there isn't one, don't do anything, but if there is, split the greeting into two and discard the left half (ie. the comma and all that precedes it).
    Then prepend the remainder with your chosen greeting, eg. in French it could be 'Bonjour'.
    This will future-proof it in case WP changes the greeting again (though if the comma gets removed, we'll have to think again…)
    If you want to keep the comma, use $x instead of $x + 1 below.
    If you don't want anything, just set $newtitle to a NULL string. */
    $x = strpos ($title, ',');
    if ($x) {
    $newtitle = 'Hello' . substr($title, $x + 1 );
    $wp_admin_bar->add_node( array(
    'id' => 'my-account',
    'title' => $newtitle,
    ) );
    }
    }
    // Set the priority to 10000 or greater to stop PHP errors:
    add_filter( 'admin_bar_menu', 'replace_howdy', 10000 );

    (Just realised this does what @ankitbnl406’s later post does in a different way.)

    • This reply was modified 3 months ago by stevegs. Reason: Added last paragraph
Viewing 14 replies - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.