Make WordPress Core

Changeset 32738


Ignore:
Timestamp:
06/12/2015 06:49:18 PM (9 years ago)
Author:
wonderboymusic
Message:

In WP_Posts_List_Table::single_row():

  • get_the_terms() can return WP_Error, so its return value should be checked before traversing.
  • Correct the @param doc blocks

See #32444.

File:
1 edited

Legend:

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

    r32725 r32738  
    675675     * @global WP_Post $post
    676676     *
    677      * @param WP_Post $post
    678      * @param int $level
     677     * @param int|WP_Post $post
     678     * @param int         $level
    679679     */
    680680    public function single_row( $post, $level = 0 ) {
     
    887887                    if ( $taxonomy ) {
    888888                        $taxonomy_object = get_taxonomy( $taxonomy );
    889                         if ( $terms = get_the_terms( $post->ID, $taxonomy ) ) {
     889                        $terms = get_the_terms( $post->ID, $taxonomy );
     890                        if ( is_array( $terms ) ) {
    890891                            $out = array();
    891892                            foreach ( $terms as $t ) {
Note: See TracChangeset for help on using the changeset viewer.