简体   繁体   English

WordPress等同于Drupal的url()

[英]WordPress equivalent of Drupal's url()

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

Check out the file link-template.php in wp-includes . wp-includeswp-includes出文件link-template.php

It's full of useful URL functions! 它充满了有用的URL函数! (also check out category-template.php for get_category_link() and get_tag_link() ). (另请get_category_link() category-template.php以获得get_category_link()get_tag_link() )。

According to the documentation for the drupal function I think the closest thing you're gonna find is site_url(). 根据drupal函数的文档,我认为您会找到的最接近的东西是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);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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