inefficiency in the WordPress 3.0 Custom Link system

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!

By admin

A ranter who in the end thanks joyfully.

5 comments

  1. 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.

Comments are closed.