From 72cff29cb69a4198ffe943629e9ad9baedac2f54 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 27 Oct 2020 16:42:05 +0000 Subject: [PATCH] Posts, Post Types: Check if taxonomy is set for the `tax_input` parameter of `wp_insert_post()`. This avoids a PHP notice when creating a post with multiple taxonomies both having a default term. Props yakimun, szaqal21, hareesh-pillai, audrasjb. Fixes #51320. Built from https://develop.svn.wordpress.org/trunk@49328 git-svn-id: http://core.svn.wordpress.org/trunk@49089 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 92d16a6290..9c41c2ae5e 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -4091,7 +4091,7 @@ function wp_insert_post( $postarr, $wp_error = false, $fire_after_hooks = true ) if ( ! empty( $tax_object->default_term ) ) { // Filter out empty terms. - if ( isset( $postarr['tax_input'] ) && is_array( $postarr['tax_input'][ $taxonomy ] ) ) { + if ( isset( $postarr['tax_input'][ $taxonomy ] ) && is_array( $postarr['tax_input'][ $taxonomy ] ) ) { $postarr['tax_input'][ $taxonomy ] = array_filter( $postarr['tax_input'][ $taxonomy ] ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index a1aac4c24f..53464904b5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-beta1-49327'; +$wp_version = '5.6-beta1-49328'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.