Opened 12 years ago
Closed 10 years ago
#27801 closed enhancement (wontfix)
`wp_dirname()` to match `wp_basename()`
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 3.9 |
| Component: | I18N | Keywords: | has-patch |
| Focuses: | Cc: |
Description
There's an i18n friendly wp_basename() function in core. Perhaps we should also add an i18n friendly version of dirname() to match it?
/**
* i18n friendly version of dirname()
*
* @since 3.9.0
*
* @param string $path A path.
* @return string
*/
function wp_dirname( $path ) {
return urldecode( dirname( str_replace( array( '%2F', '%5C' ), '/', urlencode( $path ) ) ) );
}
Attachments (1)
Change History (6)
This ticket was mentioned in Slack in #core-i18n by ocean90. View the logs.
10 years ago
This ticket was mentioned in Slack in #core-i18n by ocean90. View the logs.
10 years ago
#5
@
10 years ago
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
wp_dirname() might be handy if we display non-ASCII directory names somewhere, but apparently it doesn't have a particular use case in core right now.
Feel free to reopen if there's a use case.
Note: See
TracTickets for help on using
tickets.
Added patch with i18n friendly version of dirname.