[wp-trac] [WordPress Trac] #44162: Add is_countable() check to wp-admin/edit-form-advanced.php

WordPress Trac noreply at wordpress.org
Sun May 20 21:23:42 UTC 2018


#44162: Add is_countable() check to wp-admin/edit-form-advanced.php
--------------------------+---------------------
 Reporter:  thrijith      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.9.7
Component:  General       |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+---------------------

Comment (by thrijith):

 >but I don't think we should make such changes in the logic here, just
 keep it as simple as possible.
 Agreed.


 Also, I am thinking of updating this from

 {{{
 if ( post_type_supports( $post_type, 'page-attributes' ) ||
 ( is_countable( get_page_templates( $post ) ) && count(
 get_page_templates( $post ) ) > 0 ) )
 }}}

 to

 {{{
 $page_templates = get_page_templates( $post );
 if ( post_type_supports( $post_type, 'page-attributes' ) ||
 ( is_countable( $page_templates ) && count( $page_templates ) > 0 ) )
 }}}

 Will that be ok?

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


More information about the wp-trac mailing list