Make WordPress Core

Ticket #34348: 34348.diff

File 34348.diff, 1.7 KB (added by boonebgorges, 10 years ago)
  • src/wp-admin/includes/ajax-actions.php

    diff --git src/wp-admin/includes/ajax-actions.php src/wp-admin/includes/ajax-actions.php
    index 9955a42..f9b6f2f 100644
    function wp_ajax_add_tag() { 
    856856                'what' => 'taxonomy',
    857857                'supplemental' => compact('parents', 'noparents')
    858858        ) );
     859        _b( $tag );
    859860        $x->add( array(
    860861                'what' => 'term',
    861862                'position' => $level,
  • src/wp-includes/class-wp-term.php

    diff --git src/wp-includes/class-wp-term.php src/wp-includes/class-wp-term.php
    index 9403641..857d5fc 100644
    final class WP_Term { 
    9696        public $count = 0;
    9797
    9898        /**
    99          * Info about the term, as stored in the database.
    100          *
    101          * @since 4.4.0
    102          * @access protected
    103          * @var array
    104          */
    105         protected $data = array();
    106 
    107         /**
    10899         * Stores the term object's sanitization level.
    109100         *
    110101         * Does not correspond to a database field.
    final class WP_Term { 
    166157                foreach ( get_object_vars( $term ) as $key => $value ) {
    167158                        $this->$key = $value;
    168159                }
    169 
    170                 $this->data = sanitize_term( $term, $this->taxonomy, $this->filter );
    171160        }
    172161
    173162        /**
    final class WP_Term { 
    205194        public function __get( $key ) {
    206195                switch ( $key ) {
    207196                        case 'data' :
    208                                 return sanitize_term( $this->{$key}, $this->data->taxonomy, 'raw' );
     197                                $data = new stdClass();
     198                                $columns = array( 'term_id', 'name', 'slug', 'term_group', 'term_taxonomy_id', 'taxonomy', 'description', 'parent', 'count' );
     199                                foreach ( $columns as $column ) {
     200                                        $data->{$column} = isset( $this->{$column} ) ? $this->{$column} : null;
     201                                }
     202
     203                                return sanitize_term( $data, $data->taxonomy, 'raw' );
    209204                                break;
    210205                }
    211206        }