#20166 closed enhancement (fixed)
Function url_shorten() enhancement
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Formatting | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
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 (5)
Change History (19)
#1
@
13 years ago
- Component changed from General to Formatting
- Keywords has-patch added
- Summary changed from Function url_open() enhancement to Function url_shorten() enhancement
#2
@
13 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.
#3
@
11 years 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.
#5
@
9 years ago
- Keywords commit added
- Milestone changed from Future Release to 4.4
- Status changed from assigned to accepted
Refreshed patch in the formatting file (as requested by nacin). Updated the function with only the one new parameter, updated the docblocs, moved the unit tests, and added a unit test to cover length
#6
@
9 years ago
tests/phpunit/tests/admin/includesMisc.php needs to be removed after this is commmitted
#7
follow-up:
↓ 8
@
9 years ago
- Keywords commit removed
The function doesn't support https URLs.
Looks to me like a candidate for deprecate.php.
#8
in reply to:
↑ 7
@
9 years ago
Replying to ocean90:
The function doesn't support https URLs.
Looks to me like a candidate for deprecate.php.
The function didn't originally support it so I didn't add support when I moved it. It could easily add support
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.