[wp-trac] [WordPress Trac] #39996: Allow passing existing template value for posts, even when template does not exist

WordPress Trac noreply at wordpress.org
Thu Oct 19 00:21:16 UTC 2017


#39996: Allow passing existing template value for posts, even when template does
not exist
----------------------------------------+-----------------------
 Reporter:  danielbachhuber             |       Owner:  jnylen0
     Type:  defect (bug)                |      Status:  assigned
 Priority:  normal                      |   Milestone:  4.9
Component:  REST API                    |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  has-unit-tests needs-patch  |     Focuses:
----------------------------------------+-----------------------
Changes (by westonruter):

 * keywords:  has-patch has-unit-tests => has-unit-tests needs-patch


Comment:

 @TimothyBlynJacobs I think the `enum` should be removed entirely in favor
 of completely using the `validate_callback` as the available templates are
 dynamic.

 It turns out that the list of available page templates for a given page is
 not necessarily a subset of all of the page templates in a theme. A plugin
 can dynamically make extra page templates available for certain pages,
 being sourced from plugins. As an example, see
 [https://github.com/pojome/elementor/blob/a410436453235e9a9c6e385e573544217567ddcf/core/settings/page/manager.php#L39-L45
 from Elementor]. For more, see
 [https://github.com/WordPress/gutenberg/pull/2086#issuecomment-319208182
 discussion on Gutenberg].

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


More information about the wp-trac mailing list