[wp-trac] [WordPress Trac] #50030: Post Attributes default template's value is empty

WordPress Trac noreply at wordpress.org
Tue Nov 24 08:12:08 UTC 2020


#50030: Post Attributes default template's value is empty
-------------------------------------------------+-------------------------
 Reporter:  sandesh055                           |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Editor                               |     Version:  5.5
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing dev-         |     Focuses:
  feedback                                       |
-------------------------------------------------+-------------------------

Comment (by sandesh055):

 @noisysocks Seems like the "Before" code is updated in the latest version

 Now the line number is 1001. Check this below code,

 File : wp-admin\includes\meta-boxes.php
 Line number: 1001

 Reference code -
 {{{
 <select name="page_template" id="page_template">

 <option value="default"><?php echo esc_html( $default_title ); ?></option>
 }}}

 **--- Gutenberg Editor ---**

 After the WordPress Gutenberg update, the value of the "Default template"
 is "empty" in "Post attributes"
 Here is a screenshot - https://a.cl.ly/Jruql5AL

 **--- Classic Editor ---**

 If you enable the classic editor, then you will see the value of the
 "Default template" is "default" in "Post attributes"
 Here is a screenshot - https://a.cl.ly/7KubJnyz



 **------ Solution -----**

 I have created a fix in the diff file.

 File : wp-admin\edit-form-blocks.php
 Line number: 162

 Reference code -

 {{{
 $available_templates = ! empty( $available_templates ) ? array_merge(
         array(
                 /** This filter is documented in wp-admin/includes/meta-
 boxes.php */
                 '' => apply_filters( 'default_page_template_title', __(
 'Default template' ), 'rest-api' ),
         ),
         $available_templates
 ) : $available_templates;
 }}}

 You can see that the key of "Default template" is empty instead of
 "default"

 I hope it clears the confusion.

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


More information about the wp-trac mailing list