简体   繁体   中英

WordPress equivalent of Drupal's url()

Drupal的url()是否有任何WordPress等效功能?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM