Make WordPress Core


Ignore:
Timestamp:
09/18/2010 07:30:53 PM (14 years ago)
Author:
scribu
Message:

WP_Terms_Table cleanup:

  • use column_*() methods
  • remove $taxonomy argument from single_row()
  • don't calculate tag full name in admin-ajax.php

See #14579

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r15630 r15632  
    560560
    561561    $level = 0;
    562     $tag_full_name = false;
    563     $tag_full_name = $tag->name;
    564562    if ( is_taxonomy_hierarchical($taxonomy) ) {
    565         $_tag = $tag;
    566         while ( $_tag->parent  ) {
    567             $_tag = get_term( $_tag->parent, $taxonomy );
    568             $tag_full_name = $_tag->name . ' — ' . $tag_full_name;
    569             $level++;
    570         }
    571         $noparents = $wp_list_table->single_row( $tag, $level, $taxonomy );
    572     }
    573     $tag->name = $tag_full_name;
    574     $parents = $wp_list_table->single_row( $tag, 0, $taxonomy);
     563        $level = count( get_ancestors( $tag->term_id, $taxonomy ) );
     564        ob_start();
     565        $wp_list_table->single_row( $tag, $level );
     566        $noparents = ob_get_clean();
     567    }
     568
     569    ob_start();
     570    $wp_list_table->single_row( $tag );
     571    $parents = ob_get_clean();
    575572
    576573    $x->add( array(
     
    581578        'what' => 'term',
    582579        'position' => $level,
    583         'supplemental' => get_term( $tag->term_id, $taxonomy, ARRAY_A ) // Refetch as $tag has been contaminated by the full name.
     580        'supplemental' => $tag
    584581        ) );
    585582    $x->send();
     
    12281225        }
    12291226
    1230         echo $wp_list_table->single_row( $tag, 0, $taxonomy );
     1227        echo $wp_list_table->single_row( $tag );
    12311228    } else {
    12321229        if ( is_wp_error($updated) && $updated->get_error_message() )
Note: See TracChangeset for help on using the changeset viewer.