WordPress.org

Make WordPress Core

Changeset 33667


Ignore:
Timestamp:
08/20/2015 08:18:35 PM (5 years ago)
Author:
wonderboymusic
Message:

In WP_Posts_List_Table::inline_edit(), check that $post_formats[0] is an array before traversing.

Props DrewAPicture.
Fixes #33025.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-posts-list-table.php

    r33666 r33667  
    14741474            <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option>
    14751475            <?php
    1476 
    1477             foreach ( $post_formats[0] as $format ) {
    1478                 ?>
    1479                 <option value="<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></option>
    1480                 <?php
     1476            if ( is_array( $post_formats[0] ) ) {
     1477                foreach ( $post_formats[0] as $format ) {
     1478                    ?>
     1479                    <option value="<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></option>
     1480                    <?php
     1481                }
    14811482            }
    1482 
    14831483            ?>
    14841484        </select></label>
Note: See TracChangeset for help on using the changeset viewer.