Make WordPress Core


Ignore:
Timestamp:
01/31/2021 11:13:50 PM (4 years ago)
Author:
johnbillion
Message:

Taxonomy: Declare and document the sort and args properties of the WP_Taxonomy class.

These properties have been in use since 2.5 and 2.6 but were never added as actual properties on the class. This fixes that.

Props gunnard, SergeyBiryukov

Fixes #52142

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-taxonomy.php

    r49790 r50116  
    228228     */
    229229    public $rest_controller;
     230
     231    /**
     232     * Whether terms in this taxonomy should be sorted in the order they are provided to `wp_set_object_terms()`.
     233     *
     234     * Use this in combination with `'orderby' => 'term_order'` when fetching terms.
     235     *
     236     * @since 2.5.0
     237     * @var bool|null
     238     */
     239    public $sort = null;
     240
     241    /**
     242     * Array of arguments to automatically use inside `wp_get_object_terms()` for this taxonomy.
     243     *
     244     * @since 2.6.0
     245     * @var array|null
     246     */
     247    public $args = null;
    230248
    231249    /**
     
    305323            'default_term'          => null,
    306324            '_builtin'              => false,
     325            'sort'                  => null,
     326            'args'                  => null,
    307327        );
    308328
Note: See TracChangeset for help on using the changeset viewer.