• Pioneer Web Design

    (@swansonphotos)


    For a few sites, the clients like to change the ‘Howdy’ greeting on the admin toolbar to ‘Welcome’.

    I have always done this like this:

    
    function pioneervalley_replace_howdy( $text ) {
    $newtext = 'Welcome';
    if ( is_user_logged_in() ) {
    $text = str_replace( 'Howdy', $newtext, $text );
    }
    return $text;
    }
    add_filter( 'gettext', 'pioneervalley_replace_howdy' );

    `

    But, after updating to WP6.1, we experienced a major issue on a site when uses are logged in. Removing above resolves the problem.

    The issue is a major impact of the server resources and finally an error:

    Allowed memory size of 805306368 bytes exhausted (tried to allocate 262144 bytes) in /path/thesite.com/path/wp-includes/class-wp-hook.php on line 292

    Line 292: $this->iterations[ $nesting_level ] = array_keys( $this->callbacks );

    So, what should we now be using?

    I have lots of files (debug logs, stack traces, etc.) from the server folks who ran some tests today to help isolate this issue and to better understand it.

    Simple removing this function from the twentysixteen child theme resolves the matter fully, but, as noted, the clients want the ‘Howdy’ to be ‘Welcome’. I do not want to use a plugin for this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • threadi

    (@threadi)

    I do not get such a message. It indicates that there is an infinite loop, probably because some plugin of yours uses the gettext hook.

    I would have an alternative idea. Try this:

    function c_admin_bar_menu( $wp_admin_bar ) {
        $nodes = $wp_admin_bar->get_nodes();
    	$wp_admin_bar->remove_node('my-account');
    	if ( is_user_logged_in() ) {
    		$nodes['my-account']->title = str_replace( 'Howdy', 'Welcome', $nodes['my-account']->title );
    	}
    	$wp_admin_bar->add_node($nodes['my-account']);
    }
    add_action('admin_bar_menu', 'c_admin_bar_menu');
    Thread Starter Pioneer Web Design

    (@swansonphotos)

    I strongly encourage you to take a better look at this and stop the lack of support for classic child themes.

    Thread Starter Pioneer Web Design

    (@swansonphotos)

    To finish up here, first thank for the snippet @threadi

    I have added it in place of what was in use for so long and it works properly without issue.

    For me this issue is resolved, but am sure others will be just as unsettled by a WordPress core update causing this issue with a basic WP theme’s child theme.

    Oh, and no it’s not a plugins conflict, the issue noted occurs when there are no plugins active.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘gettext for ‘Howdy’ broken after update to 6.1’ is closed to new replies.