Is there any WordPress equivalent function for Drupal's url()
?
Check out the file link-template.php
in wp-includes
.
It's full of useful URL functions! (also check out category-template.php
for get_category_link()
and get_tag_link()
).
According to the documentation for the drupal function I think the closest thing you're gonna find is site_url().
/**
* Retrieve the site url for the current site.
*
* Returns the 'site_url' option with the appropriate protocol, 'https' if
* is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is
* overridden.
*
* @package WordPress
* @since 2.6.0
*
* @uses get_site_url()
*
* @param string $path Optional. Path relative to the site url.
* @param string $scheme Optional. Scheme to give the site url context. Currently 'http','https', 'login', 'login_post', or 'admin'.
* @return string Site url link with optional path appended.
*/
site_url(string path, string scheme);
精彩评论