Is there any WordPress equivalent function for Drupal's url()
?
views:
73answers:
3
+5
A:
As far as I know, Drupal uses a db table called url_alias
to map regular urls to nice ones, but WordPress just use that .htaccess
file. So, there will be no url()
equivalent for WordPress.
By the way you can make use of the get_page_uri()
function to get a wordpress page url.
Sepehr Lajevardi
2010-05-24 23:26:41
+2
A:
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);
Gipetto
2010-05-25 05:22:58
+3
A:
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()
).
TheDeadMedic
2010-05-26 11:44:20