[wp-trac] [WordPress Trac] #46481: Empty response if page template return zero

WordPress Trac noreply at wordpress.org
Mon Mar 25 14:53:07 UTC 2019


#46481: Empty response if page template return zero
--------------------------+------------------------------
 Reporter:  pattyland     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  5.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------
Changes (by pattyland):

 * keywords:  reporter-feedback =>


Comment:

 Hi @desrosj,

 sorry my short description. In my test case I wrote a small plugin to get
 a custom template for an url, like this:

 {{{#!php
 add_filter( 'page_template', 'wptrac_page_template' );
 function wptrac_page_template( $page_template )
 {
     if ( is_page( 'my-custom-page-slug' ) ) {
         $page_template = dirname( __FILE__ ) . '/test_template.php';
     }
     return $page_template;
 }

 }}}

 Together with the attached test_template.php this template is used for the
 page "my-custom-page-slug" is copied from the snipped above.

 I hope you unterstand me better now :)

 Best regards,
 pattyland

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


More information about the wp-trac mailing list