#29476 closed enhancement (fixed)
Hide the 'Title' field on the 'Insert from URL' tab until it's needed
Reported by: | johnbillion | Owned by: | helen |
---|---|---|---|
Milestone: | 4.2 | Priority: | high |
Severity: | normal | Version: | 3.5 |
Component: | Media | Keywords: | has-patch |
Focuses: | Cc: |
Description
As helen mentioned in IRC, the 'Title' field on the 'Insert from URL' tab in the media manager should remain hidden until we've confirmed (via AJAX) that a URL can't be embedded.
Marking as 4.0. I'll let helen/nacin/MarkJaquith make the call.
Attachments (3)
Change History (24)
#3
@
10 years ago
- Keywords commit added
In conjunction with #29473 (so that you actually see embeds when they work), this looks lovely.
#5
@
10 years ago
- Keywords commit removed
- Milestone changed from 4.0 to Future Release
- Version changed from trunk to 3.5
It has been explained to me that media straddles a line between frontend and admin contexts for translators, and thus the string swap would pose a problem. So, punting from 4.0.
However, I still think this is something we should do, and go further with it: throttle the input (in the case of somebody manually typing something in, unlikely to be very common but of course still possible), show a message that no embeddable media was found, and perhaps change the button to say "Insert link".
#6
@
10 years ago
- Milestone changed from Future Release to 4.2
We can probably use most of this, so let's look at it
#7
@
10 years ago
Patch needs to be refreshed (media-views.js doesn't exist anymore).
Also seems to be some unaddressed i18n/accessibility concerns with the interaction of toggling the title field in various contexts.
#10
@
10 years ago
- Owner set to helen
- Resolution set to fixed
- Status changed from new to closed
In 31642:
#11
@
10 years ago
- Focuses administration removed
- Keywords has-patch needs-refresh removed
- Resolution fixed deleted
- Status changed from closed to reopened
The last commit breaks the link text. It is not inserted correctly to the editor.
#14
@
9 years ago
- Priority changed from normal to high
- Resolution fixed deleted
- Status changed from closed to reopened
This seems to have introduced a regression when editing an [embed]
shortcode, see https://core.trac.wordpress.org/ticket/32006#comment:9.
Reverting [31642] and [32055] seems to fix it but needs more testing/looking into.
I'm not very sure what "Link text" has to do when inserting media. I know we fall back to inserting a link for types of media we cannot embed, but linking the file name seems better in these (rare) cases? The user will usually have to edit that anyway.
#15
@
9 years ago
Noticed one small thing:
- paste an embeddable URL
- then empty the field
- at this point
url
is an empty string - the AJAX call fires
- the "Link Text" field appears
You will also see an error in your console:
<b>Notice</b>: Undefined variable: url in <b>.../ajax-actions.php</b> on line <b>2749
that's because
if ( url && url.length < 6 ) { ...
should also check when url
is falsey.
#16
@
9 years ago
Also, not sure why 6 characters :) http://
is made by 7 characters but maybe I'm missing something.
#17
@
9 years ago
I don't really know why that "Title" field existed originally, I guess for a better fallback for non-embeddable URLs. I think we either give the user the ability to specify link text (and thus make it clear that it will insert a link), or else get rid of the field and insert just the URL, no link.
This ticket was mentioned in Slack in #core by helen. View the logs.
9 years ago
#20
@
9 years ago
- Resolution set to fixed
- Status changed from reopened to closed
#32045 opened for the stuck view issue, going to leave this as fixed for now as it's hard to trace bugs like that against a ticket with a completely unrelated summary. If we need to do something against this ticket, it'll still be here. Any bigger changes such as removing the field entirely should likely be done in another release.
@afercia That is probably worth a separate ticket, if you didn't open one already (haven't read new tickets today).
Oops, first patch missed off
media-template.php
.29476.2.diff implements the behaviour described above and also changes the 'Title' heading to 'Link Text' as per helen's request. This is an existing string which is used on the nav menu screen when adding a link to a menu item.
Related: #29473 (with independent patch).