WordPress.org

Make WordPress Core

Ticket #38765: 38765.7.diff

File 38765.7.diff, 1.4 KB (added by peterwilsoncc, 4 years ago)
  • src/wp-includes/class-wp-taxonomy.php

    diff --git src/wp-includes/class-wp-taxonomy.php src/wp-includes/class-wp-taxonomy.php
    index 4611ce9..2f4e15a 100644
    final class WP_Taxonomy { 
    196196        public $_builtin;
    197197
    198198        /**
     199         * Arguments used to register the taxonomy.
     200         *
     201         * @since 4.7.0
     202         * @access public
     203         * @var array
     204         */
     205        public $args;
     206
     207        /**
    199208         * Constructor.
    200209         *
    201210         * @since 4.7.0
    final class WP_Taxonomy { 
    337346                        $this->$property_name = $property_value;
    338347                }
    339348
    340                 $this->labels = get_taxonomy_labels( $this );
    341                 $this->label = $this->labels->name;
     349                $this->args = $args;
     350                $this->args['name'] = $this->name;
     351                $this->args['labels'] = $this->labels = get_taxonomy_labels( $this );
     352                $this->args['label'] = $this->label = $this->labels->name;
    342353        }
    343354
    344355        /**
  • src/wp-includes/taxonomy.php

    diff --git src/wp-includes/taxonomy.php src/wp-includes/taxonomy.php
    index 9ddd02c..2936c52 100644
    function register_taxonomy( $taxonomy, $object_type, $args = array() ) { 
    393393         * @param array|string $object_type Object type or array of object types.
    394394         * @param array        $args        Array of taxonomy registration arguments.
    395395         */
    396         do_action( 'registered_taxonomy', $taxonomy, $object_type, $args );
     396        var_dump( $taxonomy_object->args ); exit;
     397        do_action( 'registered_taxonomy', $taxonomy, $object_type, $taxonomy_object->args );
    397398}
    398399
    399400/**