From b2f0f4d2db0fcedd4e6626529420f6ea5d0be501 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 27 Mar 2019 15:32:11 +0000 Subject: [PATCH] Taxonomy: Initialize `$noparents` variable in `wp_ajax_add_tag()` to avoid a notice with `compact()` in PHP 7.3. Props pilou69. Fixes #46670. git-svn-id: https://develop.svn.wordpress.org/trunk@45034 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/ajax-actions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index cb39a2ee4f..206fa189a4 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -1027,7 +1027,9 @@ function wp_ajax_add_tag() { $wp_list_table = _get_list_table( 'WP_Terms_List_Table', array( 'screen' => $_POST['screen'] ) ); - $level = 0; + $level = 0; + $noparents = ''; + if ( is_taxonomy_hierarchical( $taxonomy ) ) { $level = count( get_ancestors( $tag->term_id, $taxonomy, 'taxonomy' ) ); ob_start();