printf()
outputs a formatted string, so any time it encounters a %
character followed by one or more of the elements listed in the format section of the sprintf()
man page, you will need to provide this value as one of the parameters passed to this function in order of appearance in the string (unless argument swapping is used).
For example, in the string you have, you are using %F
, which is the URL-encoded version of /
. However printf()
expects you to provide a floating point number to substitute the %F
when outputting to the page.
Since you're not actually substituting any values in your string, just echo
it instead of doing printf()
:
echo '<div class="someClass"><a href="https://domain.example/login/?redirect_to=https%3A%2F%2Fdomain.example%2FsomePage%2F%20">Login</a></div>';
Or if you want to use printf()
to be substituted into your string, I'm assuming this would be what you want:
if( ! is_user_logged_in() )
{
printf( '<div class="someClass"><a href="https://domain.example/login/?redirect_to=%s">%s</a></div>',
wp_login_url( get_permalink() ),
__( 'Login' )
);
}