[wp-trac] [WordPress Trac] #54896: TT2: Blank screen displayed for custom post type

WordPress Trac noreply at wordpress.org
Wed Jan 26 03:16:50 UTC 2022


#54896: TT2: Blank screen displayed for custom post type
---------------------------+-------------------------
 Reporter:  jffng          |       Owner:  (none)
     Type:  defect (bug)   |      Status:  closed
 Priority:  normal         |   Milestone:  5.9.1
Component:  Bundled Theme  |     Version:
 Severity:  normal         |  Resolution:  worksforme
 Keywords:                 |     Focuses:
---------------------------+-------------------------
Changes (by davidfcarr):

 * status:  new => closed
 * resolution:   => worksforme


Comment:

 For the sake of anyone who may encounter a similar issue, I traced this to
 a filter on 'single_template'

 One of the documented ways of using that function is to alter the order in
 which php templates in a theme will be evaluated for use. Apparently, this
 will have to be altered somehow to support .html templates from a block-
 based theme. I haven't seen this documented anywhere yet.

 For now, I'm disabling this functionality by checking for the existence of
 the 5.9 function locate_block_template

 {{{#!php
 <?php
 add_filter( 'single_template', 'rsvpmaker_template_order', 99 );

 function rsvpmaker_template_order( $templates = '' ) {
         if(function_exists('locate_block_template'))
                 return $templates;
 //rest of code
 }}}

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


More information about the wp-trac mailing list