开发者

WordPress equivalent of Drupal's url()

开发者_开发百科

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜