【发布时间】:2010-05-26 19:44:20
【问题描述】:
Drupal 的url() 是否有任何 WordPress 等效功能?
【问题讨论】:
标签: php wordpress drupal url-rewriting
Drupal 的url() 是否有任何 WordPress 等效功能?
【问题讨论】:
标签: php wordpress drupal url-rewriting
在wp-includes 中查看文件link-template.php。
它充满了有用的 URL 功能! (也可以查看category-template.php 获取get_category_link() 和get_tag_link())。
【讨论】:
根据 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);
【讨论】: