WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Difference between revisions of "Function Reference/set url scheme"

(Include more information about the function)
(Included note about set_url_scheme filter)
Line 16: Line 16:
   
 
=== Default Usage ===
 
=== Default Usage ===
  +
  +
== Notes ==
  +
Applies the filter <tt>set_url_scheme</tt> to the return value, passing <tt>$url</tt> (URL set in function), <tt>$scheme</tt> (scheme set in function), and <tt>$orig_scheme</tt> (the scheme passed into <tt>set_url_scheme()</tt>)
   
 
== Change Log ==
 
== Change Log ==

Revision as of 17:56, 12 December 2012

Description

Set the scheme for a URL.

Usage

 <?php $url_with_scheme set_url_scheme$url$scheme ?> 

Parameters

$url
(string) (required) Absolute url that includes a scheme.
Default: None
$scheme
(string) (optional) Scheme to give $url. Currently 'http', 'https', 'login', 'login_post', 'admin', or 'relative'. If omitted or null, will default to 'http' or 'https' based on whether is_ssl().
Default: null

Return Value

$url (string) 
URL with chosen scheme.

Examples

Default Usage

Notes

Applies the filter set_url_scheme to the return value, passing $url (URL set in function), $scheme (scheme set in function), and $orig_scheme (the scheme passed into set_url_scheme())

Change Log

Source File

set_url_scheme() is located in wp-includes/link-template.php

Related