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
This commit is contained in:
Scott Taylor 2015-06-12 18:49:18 +00:00
parent cae366cad0
commit 8463ad6f29
1 changed files with 4 additions and 3 deletions

View File

@ -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();