【问题标题】:WordPress equivalent of Drupal's url()WordPress 相当于 Drupal 的 url()
【发布时间】:2010-05-26 19:44:20
【问题描述】:

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

【问题讨论】:

    标签: php wordpress drupal url-rewriting


    【解决方案1】:

    wp-includes 中查看文件link-template.php

    它充满了有用的 URL 功能! (也可以查看category-template.php 获取get_category_link()get_tag_link())。

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 2016-06-23
        • 2014-09-07
        • 1970-01-01
        • 2016-03-07
        • 2013-06-15
        • 1970-01-01
        • 2016-08-13
        • 2012-11-11
        • 2012-08-28
        相关资源
        最近更新 更多