[wp-trac] [WordPress Trac] #34561: Abstract some embed template code into functions

WordPress Trac noreply at wordpress.org
Mon Dec 14 07:02:32 UTC 2015


#34561: Abstract some embed template code into functions
-------------------------+-----------------------------
 Reporter:  johnbillion  |       Owner:  DrewAPicture
     Type:  enhancement  |      Status:  reviewing
 Priority:  normal       |   Milestone:  Future Release
Component:  Embeds       |     Version:  4.4
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+-----------------------------

Comment (by Otto42):

 The embed template is pretty awful as-is. Replacing it entirely is pretty
 much the only option available for customizing it, and the only route that
 anybody is going to actually take, at present.

 Either the entire thing should be abstracting into sections and pieces and
 every element made filterable, or the idea should be scrapped in favor of
 wholesale replacement. As it stands, you basically have to choose one or
 the other.

 All that rectangular/square/attachment ID logic needs to be eliminated
 entirely, and moved into functions elsewhere. All that is needed in the
 template is a filter to put an image URL in. Anything more than that is
 super overkill.

 BTW, the "embed_template" filter is a bad filter name because it is shared
 with the *_template filter in get_query_template. If you hook to
 embed_template and then call get_query_template('embed') from inside that
 function, you have created an infinite loop without knowing why. Fix the
 filter names. Affects #34278 as well.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34561#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list