[wp-trac] [WordPress Trac] #28361: Twenty Ten, Eleven and Twelve: PHP notices due to undefined vars in attachment template

WordPress Trac noreply at wordpress.org
Sun May 25 23:21:23 UTC 2014


#28361: Twenty Ten, Eleven and Twelve: PHP notices due to undefined vars in
attachment template
---------------------------+--------------------
 Reporter:  nabil_kadimi   |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  4.0
Component:  Bundled Theme  |     Version:  trunk
 Severity:  minor          |  Resolution:
 Keywords:  has-patch      |     Focuses:
---------------------------+--------------------

Comment (by SergeyBiryukov):

 The only way for `$k` to be empty here is for `get_children()` to return
 an empty array a few lines above. I could not reproduce that. Do you have
 a plugin or a custom function that modifies all queries via
 `pre_get_posts` filter?

 We could just move `$k++;` to the `if ( count( $attachments ) > 1 )`
 branch a few lines below. However, it seems like we're patching the
 symptom here rather than the root cause.

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


More information about the wp-trac mailing list