[wp-trac] [WordPress Trac] #33025: Invalid argument in class-wp-posts-list-table.php

WordPress Trac noreply at wordpress.org
Fri Jul 17 11:09:03 UTC 2015


#33025: Invalid argument in class-wp-posts-list-table.php
----------------------------+-----------------------------
 Reporter:  newkind         |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:  4.2.2
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 HI,

 In the file :
 {{{
 wp-admin/includes/class-wp-posts-list-table.php
 }}}

 there's a variable $post_formats set to :
 {{{
 $post_formats = get_theme_support( 'post-formats' );
 }}}

 and right below it there's a loop which causes Warnings when $post_formats
 doesn't return array
 of arguments but boolean :

 {{{
 foreach ( $post_formats[0] as $format ) {
 }}}

 WP should check if $post_formats is array so we wouldn't end up with
 Invalid Arguments Supplied warning.

 Thanks!

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


More information about the wp-trac mailing list