[wp-trac] [WordPress Trac] #29269: save_post doesn't fire when unavailable page template saved to page

WordPress Trac noreply at wordpress.org
Mon Nov 24 15:07:17 UTC 2014


#29269: save_post doesn't fire when unavailable page template saved to page
-------------------------------+-----------------------------
 Reporter:  matthewdietsche    |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Future Release
Component:  Posts, Post Types  |     Version:  2.6
 Severity:  major              |  Resolution:
 Keywords:  4.1-early          |     Focuses:
-------------------------------+-----------------------------

Comment (by crstauf):

 that this throws an error seems to be contradictory to WordPress'
 behavior: if the page has an invalid template, when the page is visited
 (on frontend), it simply reverts down to the next relevant theme template
 file. it doesn't keep the database clean, but is returning `WP_Error` the
 right reaction to this situation? If it is, then adding `save_post` and
 `save_post_page` hooks before returning `WP_Error` seems the best fix.
 perhaps clearing the `post_template`/`_wp_page_template` post metadata is
 cleaner, but I don't think it matches expected behavior.

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


More information about the wp-trac mailing list