WordPress.org

Make WordPress Core

Ticket #16567: 16567.diff

File 16567.diff, 742 bytes (added by garyc40, 3 years ago)
  • wp-admin/admin-ajax.php

    diff --git wp-admin/admin-ajax.php wp-admin/admin-ajax.php
    index d2a8d4d..0b78deb 100644
    function _wp_ajax_add_hierarchical_term() { 
    260260                $category_nicename = sanitize_title($cat_name); 
    261261                if ( '' === $category_nicename ) 
    262262                        continue; 
    263                 if ( !($cat_id = term_exists($cat_name, $taxonomy->name, $parent)) ) { 
    264                         $new_term = wp_insert_term($cat_name, $taxonomy->name, array('parent' => $parent)); 
    265                         $cat_id = $new_term['term_id']; 
    266                 } 
     263 
     264                $new_term = wp_insert_term($cat_name, $taxonomy->name, array('parent' => $parent)); 
     265                $cat_id = $new_term['term_id']; 
    267266                $checked_categories[] = $cat_id; 
    268267                if ( $parent ) // Do these all at once in a second 
    269268                        continue;