1 comment

  1. You have the wrong values , you can’t use ← , instead use the right encoding which in that case is ← and also %s for the title.

    Also you only want this to run on two pages.

    function back_to_site_text( $translated ) {
    
        if ( in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php' ) ) )
            $translated = str_ireplace(  '← Back to %s', 'Head back to My Site',  $translated );
            return $translated;
    }
     add_filter('gettext', 'back_to_site_text');
    

Comments are closed.