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

WordPress Trac noreply at wordpress.org
Sun Feb 21 11:37:22 UTC 2016


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

Comment (by swissspidy):

 > I think the problem with this is: i saw you are planing to use
 `get_query_template()` to eventually get the embed template within the
 theme. In this case having too much hooks can be risky because it gives
 the illusion to a plugin author he can safely play at a place that won't
 be there at 100% if the theme is removing some of these hooks within its
 template.

 This is definitely a valid argument and the reason why I'm glad about
 having [attachment:34561.9.patch] as a new proposal. It's completely
 different to [attachment:34561.8.diff] and I now see that having dozens of
 new functions and hooks is not the best way forward.

 [attachment:34561.9.patch] is a good step in the right direction with the
 different compatibility files. `get_embed_template_part()` and
 `the_post_embed_thumbnail()` make it feel like embeds are totally
 different to normal theme files.

 I think we could just use `get_template_part()` and fall back to the
 theme-compat directory in `locate_template()`. Currently working on a
 patch for this.

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


More information about the wp-trac mailing list