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
This commit is contained in:
Sergey Biryukov 2019-03-27 15:32:11 +00:00
parent 432d968df6
commit b2f0f4d2db
1 changed files with 3 additions and 1 deletions

View File

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