~canonical-sysadmins/wordpress/4.8.1

« back to all changes in this revision

Viewing changes to wp-includes/category.php

  • Committer: Barry Price
  • Date: 2016-08-17 04:50:12 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: barry.price@canonical.com-20160817045012-qfui81zhqnqv2ba9
Merge WP4.6 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 * Retrieve list of category objects.
11
11
 *
12
12
 * If you change the type to 'link' in the arguments, then the link categories
13
 
 * will be returned instead. Also all categories will be updated to be backwards
 
13
 * will be returned instead. Also all categories will be updated to be backward
14
14
 * compatible with pre-2.3 plugins and themes.
15
15
 *
16
16
 * @since 2.1.0
17
17
 * @see get_terms() Type of arguments that can be changed.
18
18
 *
19
19
 * @param string|array $args {
20
 
 *     Optional. Arguments to retrieve categories. See {@see get_terms()} for additional options.
 
20
 *     Optional. Arguments to retrieve categories. See get_terms() for additional options.
21
21
 *
22
22
 *     @type string $taxonomy Taxonomy to retrieve terms for. In this case, default 'category'.
23
23
 * }
30
30
        $taxonomy = $args['taxonomy'];
31
31
 
32
32
        /**
33
 
         * Filter the taxonomy used to retrieve terms when calling {@see get_categories()}.
 
33
         * Filters the taxonomy used to retrieve terms when calling get_categories().
34
34
         *
35
35
         * @since 2.7.0
36
36
         *
37
37
         * @param string $taxonomy Taxonomy to retrieve terms from.
38
 
         * @param array  $args     An array of arguments. See {@see get_terms()}.
 
38
         * @param array  $args     An array of arguments. See get_terms().
39
39
         */
40
40
        $taxonomy = apply_filters( 'get_categories_taxonomy', $taxonomy, $args );
41
41
 
42
42
        // Back compat
43
43
        if ( isset($args['type']) && 'link' == $args['type'] ) {
44
44
                /* translators: 1: "type => link", 2: "taxonomy => link_category" alternative */
45
 
                _deprecated_argument( __FUNCTION__, '3.0',
 
45
                _deprecated_argument( __FUNCTION__, '3.0.0',
46
46
                        sprintf( __( '%1$s is deprecated. Use %2$s instead.' ),
47
47
                                '<code>type => link</code>',
48
48
                                '<code>taxonomy => link_category</code>'
77
77
 * If you look at get_term(), then both types will be passed through several
78
78
 * filters and finally sanitized based on the $filter parameter value.
79
79
 *
80
 
 * The category will converted to maintain backwards compatibility.
 
80
 * The category will converted to maintain backward compatibility.
81
81
 *
82
82
 * @since 1.5.1
83
83
 *
271
271
        }
272
272
 
273
273
        /**
274
 
         * Filter the array of term objects returned for the 'post_tag' taxonomy.
 
274
         * Filters the array of term objects returned for the 'post_tag' taxonomy.
275
275
         *
276
276
         * @since 2.3.0
277
277
         *