Opened 15 years ago
Closed 11 years ago
#11446 closed defect (bug) (fixed)
Show ellipsis after truncated filename in Media dialog
Reported by: | caesarsgrunt | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 3.6 | Priority: | normal |
Severity: | normal | Version: | 2.9 |
Component: | General | Keywords: | has-patch dev-feedback needs-codex |
Focuses: | Cc: |
Description
Ellipses should be shown after truncated filenames in the Media dialog (and anywhere else where they are truncated, actually).
Otherwise it is sometimes hard to identify pictures.
Attachments (6)
Change History (22)
#3
in reply to:
↑ 2
@
15 years ago
Replying to hakre:
Can you provide a screenshot of the locations you see fit?
I'm not sure what you mean by the "locations you see fit".
If you mean where should there be ellipses; then the answer is anywhere a file name is truncated (at the end of the part of the name which is shown).
So for example, if I have an image called This image has a name which is too long to show fully}}, then it would currently be shown as something like {{{This image has a name
. Instead, it should be This image has a name...
.
Alternatively we could do it the OS X way, with the ellipsis in the middle. Then it would be something like This image has ... fully
.
I'll do a patch later for the first method; it shouldn't be hard.
#4
@
15 years ago
Grrr... I hate it when Trac does that to my formatting and then won't let me fix it! Should preview, I know...
#5
@
15 years ago
Was able to reproduce, you're right. I'll attach the image I was able to reproduce with.
#10
@
14 years ago
- Keywords has-patch dev-feedback added; needs-patch removed
Added a patch to add an ellipsis to truncated html strings. This will however increase the returned string length beyond $count
specified in wp_html_excerpt()
. If this is going to be an issue then I can modify the patch to account for this.
#11
@
14 years ago
An additional flag in wp_html_excerpt()
would be nice. Something like:
function wp_html_excerpt( $str, $count, $ellipsis = false )
Otherwise this can break themes. $ellipsis
can be true
when you use it in the Media dialog, or other WP core places. But it should default to false
.
#12
@
14 years ago
Replying to garyc40:
An additional flag in
wp_html_excerpt()
would be nice. Something like:
Added this in attachment:11446.2.diff. Actually there are lots of places in core where we were adding the ellipsis manually (see patch), so adding this argument makes sense.
Changes will probably need testing to make sure nothing awkward happens - in some cases I have replaced '...
' with '…
'.
#13
follow-up:
↓ 15
@
12 years ago
- Cc bpetty added
- Component changed from Media to General
- Keywords needs-codex added
- Milestone changed from Future Release to 3.6
I've refreshed 11446.2.diff as 11446.3.patch with a minor change of using a named option array with wp_html_excerpt()
for specifying extra optional settings. See coding standards for reason behind named option.
This will still need Codex updates (and I can do this) if applied.
#14
@
11 years ago
Refreshed: 11446.4.patch
#15
in reply to:
↑ 13
@
11 years ago
Replying to bpetty:
I've refreshed 11446.2.diff as 11446.3.patch with a minor change of using a named option array with
wp_html_excerpt()
for specifying extra optional settings. See coding standards for reason behind named option.
A cleaner approach might be to make it a $more
string, for consistency with wp_trim_words()
:
http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/formatting.php#L2159
This would be more flexible and also would allow us to avoid a named entity in XML context (an issue raised in ticket:8714:27).
See 11446.5.patch.
Can you provide a screenshot of the locations you see fit?