Opened 15 years ago
Closed 13 years ago
#11314 closed enhancement (wontfix)
Attribute "Alt" on images must to be improved on editor
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.9 |
Component: | Database | Keywords: | dev-feedback |
Focuses: | Cc: |
Description
Recently i noted a change in WP 2.9 beta about ALT attribute. At last is possible include an alternative string without touch the caption.
However, this ALT string is stored on wpdb_postmeta table; why to proceed in this way? Now WP 2.9 must to query two large tables to construct a simple image tag. On the other hand, is true the actual Alt/Caption problem must to be solved. I propose:
- Using post_title for "title", post_content for "caption"/"description" (shared) and post_excerpt for "ALT" text. or...
- Use the same db structure as WP 2.8.X, with the difference a new checkbox would be added for activate caption, as is shown in the image i'm attaching.
If three fields into wpbd_posts are available to this job, why to use a postmeta field to store ALT data? I don't understand the reason.
Regards.
Attachments (4)
Change History (14)
#1
follow-up:
↓ 3
@
15 years ago
- Keywords dev-feedback added; image alt alternative caption title removed
- Milestone changed from 2.9 to 3.0
You can't store the caption and the description in the same db field. Only if we drop one or the other.
Anyway, enhancements are punted to the next major release.
#3
in reply to:
↑ 1
@
15 years ago
Replying to scribu:
You can't store the caption and the description in the same db field. Only if we drop one or the other.
Anyway, enhancements are punted to the next major release.
Hi. I mentioned more than one idea. Really they're based on one question: Not all the images have caption or description (even title), but all images have ALT text, so why to use the postmeta field for store an element so extensive as this attribute?. This is illogical.
For one side there are 4 strings to store: title, alt, caption and description; for the other side there are 3 DB fields on $wpdb->posts: post_title, post_excerpt and post_content. ALT attribute is the more queried string of those four, so I do not understand why WP has to always check 2 tables ($wpbd->posts and $wpbd->postmeta) to retrieve the data, when otherwise (assigning ALT to one of those 3 DB fields) the query is limited only to $wpbd->post.
#4
@
15 years ago
- Cc ricky@… added
Is this correct:
- Including a captionless image in a post queries just the alt and title data.
- Including a captioned image in a post queries the caption, title and alt.
- Viewing the attachment page queries all four fields.
- On the admin side, working with the media manager queries all four fields.
- Did I miss any major use cases?
If this is the case it would seem to be more sensible to store the description in the second database table, as that is in theory queried less often.
I may be wrong about the description not being included with embedded images though, in which case there's no need to change it.
#5
@
15 years ago
A captionless image doesn't query the database at all, except when inserted in the editor. (That may change, of course -- introducing an image shortcode has been discussed as a way to introduce trash for media for 3.0.)
#6
@
15 years ago
- Cc metacortex added
@rickybuchanan, once the image is included in a post (with or without caption) it don't queries nothing because has a whole static data.
#7
follow-up:
↓ 8
@
15 years ago
Of course. Please excuse my complete brain failure in writing that post, that'll teach me to comment after midnight ... so @metacortex what's the reason for wanting to change the DB structure if it's not for load reasons? I haven't noticed any failure in function (as an end user) with the current implementation.
#8
in reply to:
↑ 7
@
15 years ago
Hi @rickybuchanan,
Replying to rickybuchanan:
what's the reason for wanting to change the DB structure if it's not for load reasons? I haven't noticed any failure in function (as an end user) with the current implementation.
Sometimes is needed. E.g., I developed an image based plugin, which query all these data all time.
One thing is to place the data staticly within the content, and another thing is to store it to use it for X purpose. ;)
#9
@
15 years ago
- Milestone changed from 3.0 to Future Release
I would use post_title for both title and alt text. If not, then use post_content for both description and caption (as suggested in nueva-opcion-texto-alt-wp-1.jpg).
Either way, one of the fields would have to dissapear from the admin, since there's no point in having two fields that point to the same data.
Punting to Future Release, since we don't have a consensus on the matter.
An idea for aviod conflict between Caption and Alt elements. Note the checkbox on the right.