[wp-trac] [WordPress Trac] #36838: Invalid argument supplied for foreach() in /wp-includes/theme-compat/embed-content.php on line 32

WordPress Trac noreply at wordpress.org
Fri May 13 21:56:54 UTC 2016


#36838: Invalid argument supplied for foreach() in /wp-includes/theme-compat/embed-
content.php on line 32
--------------------------+-----------------------------
 Reporter:  MarkRH        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Embeds        |    Version:  4.5.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 This is a follow-up to #35237.

 Looks like this bug is happening again. If it was fixed, it's not now.
 This embed URL causes it on my blog:
 http://blog.markheadrick.com/2011/12/13/blog-updated-to-wordpress-3-3-and-
 other-website-changes/embed/

 It's this line of code:

 {{{
 foreach ( $meta['sizes'] as $size => $data ) {
 }}}


 The $meta array is:

 {{{
 Array
 (
     [width] => 140
     [height] => 105
     [hwstring_small] => height='96' width='128'
     [file] => 2010/12/markrh_s2.jpg
     [image_meta] => Array
         (
             [aperture] => 0
             [credit] =>
             [camera] =>
             [caption] =>
             [created_timestamp] => 0
             [copyright] =>
             [focal_length] => 0
             [iso] => 0
             [shutter_speed] => 0
             [title] =>
         )

 )
 }}}

 As you can see there is no [sizes] section. Looks like the check mentioned
 in my previous bug is no longer in the code, if it was added. This is an
 older post with a single image associated with it at the single size.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36838>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list