|Reported by:||caesarsgrunt||Owned by:|
|Cc:||pavelevap@…, scribu@…, peterchester, mhbarr, sbressler|
Add a shortcode for images, rather than inserting static html code into posts/pages.
This complements the media stuff being done in 3.0 and has many benefits, including
- allowing images to be trashed
- allowing plugins and themes to modify the code used to show images
- removing broken img tags from posts when the image is deleted
As discussed on dev chat 10-12-2009.
Proposed syntax :
Shortcode name : image
Required attributes :
- id - the id of the image
Optional attributes :
- align - left|center|right - default to none (inline)
- size - thumb|medium|full - default to thumb
- title - HTML title/alt attribute - default to value in db
- width - HTML width attribute - default to width of image
- height - HTML height attribute - default to height of image
Other attributes are probably also needed, but I can't think of any more at present.
Captions would be handled by the existing caption shortcode.
Other media which is embedded straight in the post would need its own shortcodes (eg [video]), but at the moment other media seems always to only be linked to anyway.
A single [media] shortcode wouldn't be a good solution since every type of media has different attributes and needs to be handled differently.
This solution is backwards-compatible, in that existing image would continue to work, but it might be nice to update existing images to use the shortcode as part of the upgrade process.
Change History (55)
comment:3 in reply to: ↑ 2 ; follow-up: ↓ 4 caesarsgrunt — 4 years ago
- Type changed from feature request to task (blessed)
comment:10 follow-up: ↓ 16 hakre — 4 years ago
- Keywords reporter-feedback added
- Milestone changed from 3.0 to Future Release
- Version set to 2.9
comment:12 nacin — 4 years ago
- Keywords dev-feedback added; reporter-feedback removed
- Milestone changed from Future Release to 3.0
comment:18 nacin — 4 years ago
- Milestone changed from 3.0 to 3.1
- Type changed from task (blessed) to feature request