[wp-trac] [WordPress Trac] #11394: Image shortcode

WordPress Trac wp-trac at lists.automattic.com
Fri Dec 11 12:00:13 UTC 2009


#11394: Image shortcode
-----------------------------+----------------------------------------------
 Reporter:  caesarsgrunt     |       Owner:     
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  3.0
Component:  Media            |     Version:     
 Severity:  normal           |    Keywords:     
-----------------------------+----------------------------------------------
 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[[BR]]
 * allowing images to be trashed[[BR]]
 * allowing plugins and themes to modify the code used to show images[[BR]]
 * removing broken img tags from posts when the image is deleted[[BR]]

 As discussed on dev chat 10-12-2009.

 '''Proposed syntax''' :[[BR]]
 ''Shortcode name'' : {{{image}}}[[BR]]
 ''Required attributes'' :[[BR]]
 * {{{id}}} - the id of the image[[BR]]
 ''Optional attributes'' :[[BR]]
 * {{{align}}} - {{{left|center|right}}} - default to none (inline)[[BR]]
 * {{{size}}} - {{{thumb|medium|full}}} - default to {{{thumb}}}[[BR]]
 * {{{title}}} - HTML title/alt attribute - default to value in db[[BR]]
 * {{{width}}} - HTML width attribute - default to width of image[[BR]]
 * {{{height}}} - HTML height attribute - default to height of image[[BR]]
 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.[[BR]]
 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.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11394>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list