From 8463ad6f29e9ccaeb4385bc0424d010b4636b726 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 12 Jun 2015 18:49:18 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@32738 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-posts-list-table.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php index ae9c0ec562..c5f95119f7 100644 --- a/src/wp-admin/includes/class-wp-posts-list-table.php +++ b/src/wp-admin/includes/class-wp-posts-list-table.php @@ -674,8 +674,8 @@ class WP_Posts_List_Table extends WP_List_Table { * @global string $mode * @global WP_Post $post * - * @param WP_Post $post - * @param int $level + * @param int|WP_Post $post + * @param int $level */ public function single_row( $post, $level = 0 ) { global $mode; @@ -886,7 +886,8 @@ class WP_Posts_List_Table extends WP_List_Table { if ( $taxonomy ) { $taxonomy_object = get_taxonomy( $taxonomy ); - if ( $terms = get_the_terms( $post->ID, $taxonomy ) ) { + $terms = get_the_terms( $post->ID, $taxonomy ); + if ( is_array( $terms ) ) { $out = array(); foreach ( $terms as $t ) { $posts_in_term_qv = array();