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

WordPress Trac wp-trac at lists.automattic.com
Fri Mar 5 22:49:19 UTC 2010


#11394: Image shortcode
-----------------------------+----------------------------------------------
 Reporter:  caesarsgrunt     |       Owner:                          
     Type:  feature request  |      Status:  new                     
 Priority:  normal           |   Milestone:  3.1                     
Component:  Media            |     Version:  2.9                     
 Severity:  normal           |    Keywords:  needs-patch dev-feedback
-----------------------------+----------------------------------------------

Comment(by Otto42):

 Replying to [comment:33 caesarsgrunt]:
 > So you suggest duplicating the shortcode parser to parse HTML tags
 instead of shortcodes, so that we can remove the html tag on the fly if
 the image doesn't exist? It's an idea, but probably a lot more work than a
 new shortcode and it strikes me as a rather messy solution. Does anyone
 else have an opinion on this? Is anyone willing to try implementing it? (I
 don't have time right now.)

 Actually, it's a lot LESS work, because you won't have to modify the media
 system to create shortcodes as well.

 Also, we have a pretty darned good HTML parser built right into the
 system. Look closely at kses. Finding the img codes in the content is
 trivial, parsing them into attributes is relatively easy with kses, and
 then taking action to then remove the img tag on the fly is relatively
 easy as well. The hard part is looking in the database to find trashed
 images.

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


More information about the wp-trac mailing list