Below I noted WordPress 3.0’s new ability to create custom links. One small item that bothered me was the fact the WordPress 3.0 forced the link to be of the form “http://…” When I plugged in a direct link “../csalaz.html”, WordPress forced a change to “http://../csalaz.html”, which is nonsense. I dislike inefficiency, so I found the relevant path to the code that forced the change:
wp-admin\nav-menus.php
wp-admin\includes\nav-menu.php
wp-includes\nav-menu.php
wp-includes\formatting.php
/**
* Checks and cleans a URL.
*
* A number of characters are removed from the URL. If the URL is for displaying
* (the default behaviour) amperstands are also replaced. The ‘clean_url’ filter
* is applied to the returned cleaned URL.
*
* @since 2.8.0
* @uses wp_kses_bad_protocol() To only permit protocols in the URL set
* via $protocols or the common ones set in the function.
*
* @param string $url The URL to be cleaned.
* @param array $protocols Optional. An array of acceptable protocols.
* Defaults to ‘http’, ‘https’, ‘ftp’, ‘ftps’, ‘mailto’, ‘news’, ‘irc’, ‘gopher’, ‘nntp’, ‘feed’, ‘telnet’ if not set.
* @param string $_context Private. Use esc_url_raw() for database usage.
* @return string The cleaned $url after the ‘clean_url’ filter is applied.
*/
function esc_url( $url, $protocols = null, $_context = ‘display’ ) {
I modified this function and am now able to use the much faster link, “../csalaz.html” to return to the parent page of this web log.
Thank you for letting me do this WordPress!
Thinking. It’s always the same thing. To think is to go insane.
Great information! I’ve been looking for something like this for a while now. Thanks!
If you’re asking a question I would be happy to answer.
The custom link does work, just click it to return to the parent web page.
Hey, ok, I get it, I guess – but does this really work?
Genial dispatch and this mail helped me alot in my college assignement. Gratefulness you for your information.