[wp-trac] [WordPress Trac] #23282: Add shortcodes for inline HTML5 audio / video

WordPress Trac noreply at wordpress.org
Thu Jun 13 18:05:37 UTC 2013


#23282: Add shortcodes for inline HTML5 audio / video
-----------------------------+---------------------
 Reporter:  wonderboymusic   |       Owner:
     Type:  feature request  |      Status:  closed
 Priority:  normal           |   Milestone:  3.6
Component:  Media            |     Version:  trunk
 Severity:  normal           |  Resolution:  fixed
 Keywords:                   |
-----------------------------+---------------------

Comment (by amereservant):

 Replying to [comment:83 Otto42]:
 > The shortcode_exists function is the correct way to check for this sort
 of thing, because checking the global $shortcode_tags directly in every
 place where it's used is not clear. Code should be self-explanatory and
 easy to maintain, not optimized beyond the point of sanity. The overhead
 of an additional function call is minimal, and the benefit of clarity in
 understanding what the code is doing is worth the cost.

 Fair enough ... I was just pondering it, not that I know better by any
 means.  I spend a lot of time coding plugins, etc. and always trying to
 use best practices etc.  So understanding when to propose new functions
 helps in knowing when to do so in my contributions as well.



 > Not saying that there's no room for performance improvements here, but
 shortcode_exists() is not an example of bloat. And while there may be
 better ways to implement has_shortcode(), it's not the same thing to find
 out if a shortcode exists immediately prior to executing it vs. before
 processing the content. Now, has_shortcode() may no longer be needed since
 post-formats is getting ripped out of core for 3.6 and I don't think it
 was used elsewhere. If it's going to become unused, it might be worth
 removing from 3.6 as well.

 Well the funny thing is, {{{has_shortcode()}}} is a new function as of
 '''3.6'''.

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


More information about the wp-trac mailing list