[wp-trac] [WordPress Trac] #56847: Template parts and patterns

WordPress Trac noreply at wordpress.org
Tue Oct 18 21:13:38 UTC 2022


#56847: Template parts and patterns
-------------------------------+-----------------------------
 Reporter:  matteomarchiori97  |      Owner:  (none)
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Themes             |    Version:  6.0.3
 Severity:  normal             |   Keywords:
  Focuses:  template           |
-------------------------------+-----------------------------
 Good day,
 I am developing a WordPress theme (published, but still work in progress,
 W3CSSPress).
 While I was trying to get a value from a function (in functions.php) into
 a component of the theme I noticed a strage behavior.

 If I try to develop a normal template part in HTML and include in it a
 pattern which contains a dynamic content, then I move away the templates
 and reload the website (classic version of the theme) and then I move back
 the templates (block version of the theme) I find that the dynamic
 generated part got cached and is not generated again anymore.

 Istead, if I avoid to use a template part and I put its content inside a
 pattern and I call it from the templates of the pages (like, front-
 page.html) the content gets dynamically regenerated correctly.

 This could be a good behavior from a caching and performance point of
 view, but if a template part has got some dynamic content it should be
 regenerated.

 Is it fixable in some way?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56847>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list