• site_url and get_site_url accept a parameter named $scheme. $scheme can be set to http, https, login, login_post, admin or relative.

    http and https are obvious schemes.

    What do login, login_post, admin and relative do? What scheme does each of these provide and when/why?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Have you tried testing them out with a simple echo?

    I’d assume they’d suffix the url with /wp-login.php etc

    Moderator bcworkz

    (@bcworkz)

    There’s no suffixing so echoing would bring no joy.

    Relative is exactly that, no http/domain whatever, just the relative link. Useful for theme resources if you’re writing a theme and want the HTML to end up something like <img src="images/logo.png" />

    The admin, login etc. all invoke the same logic. If FORCE_SSL_ADMIN is true then the URL retuned is https, otherwise http is used.

    I’m assuming the reason for multiple arguments doing the same thing is to allow for finer control in the future, or for backward compatibility for differences that are no longer valid.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘What do the schemes login, login_post, admin, and relative mean?’ is closed to new replies.