Make WordPress Core

Opened 2 years ago

Last modified 3 months ago

#20166 new enhancement

Function url_shorten() enhancement

Reported by: mulvane Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Formatting Keywords: has-patch
Focuses: Cc:


The function url_open is included in the wp_admin/includes/misc.php and is not usable unless loaded. This is not loaded by default so not available site wide. Also, the function is very static as of right now in its use with no defined options. Options to set length of the shortened url and the ability to turn on off the cutting of the leading "http://www" and the trailing slashes are included in this patch.

Attachments (1)

url_shorten.patch (1.9 KB) - added by mulvane 2 years ago.

Download all attachments as: .zip

Change History (4)

mulvane2 years ago

comment:1 dd322 years ago

  • Component changed from General to Formatting
  • Keywords has-patch added
  • Summary changed from Function url_open() enhancement to Function url_shorten() enhancement

Makes sense to move it to a more neutral location perhaps, but I'd suggest that adding anything other than the length cutoff isn't needed for core.

comment:2 mulvane2 years ago

I mostly agree but there are more than a few sites where cutting off the www or removing the trailing slash will break the link. For visual purposes, its nice to see them when they are required.

comment:3 nacin3 months ago

  • Milestone changed from Awaiting Review to Future Release

This seems like a good candidate for formatting.php, versus the generic (and early-loaded) functions.php.

mulvane, you make a good point, but I agree with dd32 that we shouldn't deal with anything in core other than the length cut-off.

Note: See TracTickets for help on using tickets.