[wp-trac] [WordPress Trac] #54931: get_block_template filter not fired when saved in posts

WordPress Trac noreply at wordpress.org
Wed Jan 26 15:45:54 UTC 2022


#54931: get_block_template filter not fired when saved in posts
--------------------------+-----------------------------
 Reporter:  ianmjones     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:  5.9
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The `\get_block_template()` function fires a 'get_block_template' filter
 at the end that allows for plugins to filter the content etc.

 However, this only works if the template was retrieved from a theme's
 template file, if the template has been edited it is saved into the
 `posts` table.

 When a template (part) is found in the `posts` table the function exits
 early with the found template but does not wrap the return in a call to
 the 'get_block_template'.

 This means plugins and custom code do not get a chance to filter the
 template's content or properties when re-editing after a template has had
 an initial edit.

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


More information about the wp-trac mailing list