wp_list_categories( array|string $args = '' ): void|string|false
- Since
- 2.1.0, 4.4.0, 4.4.0, 6.1.0
- Source
wp-includes/category-template.php:538
Compatibility
- WordPress
- since 6.1.0
- PHP
- 7.4–8.6-dev
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.
Parameters
$argsarray|stringoptional- Array of optional arguments. See get_categories(), get_terms(), and WP_Term_Query::__construct() for information on additional accepted arguments.Default:
''$current_categoryint|int[]default: 0ID of category, or array of IDs of categories, that should get the 'current-cat' class.$depthintdefault: 0Category depth. Used for tab indentation.$echobool|intdefault: 1Whether to echo or return the generated markup. Accepts 0, 1, or their bool equivalents.$excludeint[]|stringdefault: empty stringArray or comma/space-separated string of term IDs to exclude. If$hierarchicalis true, descendants of$excludeterms will also be excluded; see$exclude_tree. See get_terms().$exclude_treeint[]|stringdefault: empty stringArray or comma/space-separated string of term IDs to exclude, along with their descendants. See get_terms().$feedstringdefault: 'Feed for all posts filed under [cat name]'Text to use for the feed link.$feed_imagestringdefault: empty stringURL of an image to use for the feed link.$feed_typestringdefault: empty string (default feed)Feed type. Used to build feed link. See get_term_feed_link().$hide_title_if_emptybooldefault: false (title will always be shown)Whether to hide the$title_lielement if there are no terms in the list.$separatorstringdefault: ' 'Separator between links.$show_countbool|intdefault: 0Whether to include post counts. Accepts 0, 1, or their bool equivalents.$show_option_allstringdefault: empty stringText to display for showing all categories.$show_option_nonestringdefault: 'No categories'Text to display for the 'no categories' option.$stylestringdefault: 'list'The style used to display the categories list. If 'list', categories will be output as an unordered list. If left empty or another value, categories will be output separated by<br>tags.$taxonomystringdefault: 'category'Name of the taxonomy to retrieve.$title_listringdefault: 'Categories'Text to use for the list title<li>element. Pass an empty string to disable.$use_desc_for_titlebool|intdefault: 0Whether to use the category description as the title attribute. Accepts 0, 1, or their bool equivalents.$walkerWalkerdefault: empty which results in a Walker_Category instance being usedWalker object to use to build the output.
Return value
void|string|false- Void if 'echo' argument is true, HTML list of categories if 'echo' is false.
False if the taxonomy does not exist.
Performance profile
How much work a call to wp_list_categories() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Heavy
- Scaling
- Constant
- Instructions
- 82–160
- Plugin surface
- 1 hook
- Called by
- 3
Reaches the database via get_terms().
No loop in the body: the same number of instructions runs whatever you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 259.
Third-party callbacks on 'wp_list_categories' run inside this call, and their cost is not bounded by anything here.
3 places in core call this, so the cost is paid more often than your own code shows.
What it touches
- optionoption read or write
get_option()called directly - hookthird-party callbacks
apply_filters()called directly - querycontent query
get_terms()one call below wp_list_categories() - cacheobject cache
wp_cache_get()one call below wp_list_categories() - serializeserialisation
maybe_unserialize()one call below wp_list_categories()
Further down the call graph this can also reach transient. That is the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 40 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost wp_list_categories() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && empty($show_option_all) && !empty($parsed_args) | 82–92 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && empty($show_option_all) && empty($parsed_args) && is_category() | 89–103 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), is_category(), get_queried_object(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && empty($show_option_all) && empty($parsed_args) && !is_category() && !is_tax() && !is_tag() | 91–101 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), is_category(), is_tax(), is_tag(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && empty($show_option_all) && empty($parsed_args) && !is_category() && is_tax() | 92–106 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), is_category(), is_tax(), get_queried_object(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && empty($show_option_all) && empty($parsed_args) && !is_category() && !is_tax() && is_tag() | 95–109 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), is_category(), is_tax(), is_tag(), get_queried_object(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && empty($show_option_all) && empty($parsed_args) && is_category() | 97–107 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), is_category(), get_queried_object(), get_queried_object_id(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && empty($show_option_all) && empty($parsed_args) && !is_category() && is_tax() | 100–110 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), is_category(), is_tax(), get_queried_object(), get_queried_object_id(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && empty($show_option_all) && empty($parsed_args) && !is_category() && !is_tax() && is_tag() | 103–113 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), is_category(), is_tax(), is_tag(), get_queried_object(), get_queried_object_id(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && !empty($parsed_args) | 107–125 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), esc_url(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && empty($parsed_args) && is_category() | 114–135 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), esc_url(), is_category(), get_queried_object(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && !empty($parsed_args) | 116–131 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), home_url(), esc_url(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && empty($parsed_args) && !is_category() && !is_tax() && !is_tag() | 116–133 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), esc_url(), is_category(), is_tax(), is_tag(), walk_category_tree(), apply_filters() |
28 further outcomes, up to 160 instructions
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && empty($parsed_args) && !is_category() && is_tax() | 117–138 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), esc_url(), is_category(), is_tax(), get_queried_object(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && !get_option() && !empty($parsed_args) | 120–135 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), get_option(), home_url(), esc_url(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && empty($parsed_args) && !is_category() && !is_tax() && is_tag() | 120–141 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), esc_url(), is_category(), is_tax(), is_tag(), get_queried_object(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && empty($parsed_args) && is_category() | 122–139 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), esc_url(), is_category(), get_queried_object(), get_queried_object_id(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && empty($parsed_args) && is_category() | 123–142 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), home_url(), esc_url(), is_category(), get_queried_object(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && get_option() && !empty($parsed_args) | 124–139 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), get_option(), get_option(), get_permalink(), esc_url(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && empty($parsed_args) && !is_category() && is_tax() | 125–142 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), esc_url(), is_category(), is_tax(), get_queried_object(), get_queried_object_id(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && empty($parsed_args) && !is_category() && !is_tax() && !is_tag() | 125–140 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), home_url(), esc_url(), is_category(), is_tax(), is_tag(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && empty($parsed_args) && !is_category() && is_tax() | 126–145 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), home_url(), esc_url(), is_category(), is_tax(), get_queried_object(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && !get_option() && empty($parsed_args) && is_category() | 127–146 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), get_option(), home_url(), esc_url(), is_category(), get_queried_object(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && empty($parsed_args) && !is_category() && !is_tax() && is_tag() | 128–145 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), esc_url(), is_category(), is_tax(), is_tag(), get_queried_object(), get_queried_object_id(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && empty($parsed_args) && !is_category() && !is_tax() && is_tag() | 129–148 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), home_url(), esc_url(), is_category(), is_tax(), is_tag(), get_queried_object(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && !get_option() && empty($parsed_args) && !is_category() && !is_tax() && !is_tag() | 129–144 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), get_option(), home_url(), esc_url(), is_category(), is_tax(), is_tag(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && !get_option() && empty($parsed_args) && !is_category() && is_tax() | 130–149 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), get_option(), home_url(), esc_url(), is_category(), is_tax(), get_queried_object(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && empty($parsed_args) && is_category() | 131–146 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), home_url(), esc_url(), is_category(), get_queried_object(), get_queried_object_id(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && get_option() && empty($parsed_args) && is_category() | 131–150 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), get_option(), get_option(), get_permalink(), esc_url(), is_category(), get_queried_object(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && !get_option() && empty($parsed_args) && !is_category() && !is_tax() && is_tag() | 133–152 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), get_option(), home_url(), esc_url(), is_category(), is_tax(), is_tag(), get_queried_object(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && get_option() && empty($parsed_args) && !is_category() && !is_tax() && !is_tag() | 133–148 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), get_option(), get_option(), get_permalink(), esc_url(), is_category(), is_tax(), is_tag(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && empty($parsed_args) && !is_category() && is_tax() | 134–149 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), home_url(), esc_url(), is_category(), is_tax(), get_queried_object(), get_queried_object_id(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && get_option() && empty($parsed_args) && !is_category() && is_tax() | 134–153 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), get_option(), get_option(), get_permalink(), esc_url(), is_category(), is_tax(), get_queried_object(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && !get_option() && empty($parsed_args) && is_category() | 135–150 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), get_option(), home_url(), esc_url(), is_category(), get_queried_object(), get_queried_object_id(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && empty($parsed_args) && !is_category() && !is_tax() && is_tag() | 137–152 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), home_url(), esc_url(), is_category(), is_tax(), is_tag(), get_queried_object(), get_queried_object_id(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && get_option() && empty($parsed_args) && !is_category() && !is_tax() && is_tag() | 137–156 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), get_option(), get_option(), get_permalink(), esc_url(), is_category(), is_tax(), is_tag(), get_queried_object(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && !get_option() && empty($parsed_args) && !is_category() && is_tax() | 138–153 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), get_option(), home_url(), esc_url(), is_category(), is_tax(), get_queried_object(), get_queried_object_id(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && get_option() && empty($parsed_args) && is_category() | 139–154 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), get_option(), get_option(), get_permalink(), esc_url(), is_category(), get_queried_object(), get_queried_object_id(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && !get_option() && empty($parsed_args) && !is_category() && !is_tax() && is_tag() | 141–156 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), get_option(), home_url(), esc_url(), is_category(), is_tax(), is_tag(), get_queried_object(), get_queried_object_id(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && get_option() && empty($parsed_args) && !is_category() && is_tax() | 142–157 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), get_option(), get_option(), get_permalink(), esc_url(), is_category(), is_tax(), get_queried_object(), get_queried_object_id(), walk_category_tree(), apply_filters() |
isset($parsed_args) && !$parsed_args && taxonomy_exists() && !empty($categories) && !empty($show_option_all) && get_option() && empty($parsed_args) && !is_category() && !is_tax() && is_tag() | 145–160 | __(), __(), wp_parse_args(), taxonomy_exists(), get_categories(), get_taxonomy(), get_option(), get_option(), get_option(), get_permalink(), esc_url(), is_category(), is_tax(), is_tag(), get_queried_object(), get_queried_object_id(), walk_category_tree(), apply_filters() |
This body has more branch combinations than are worth enumerating, so the table covers the outcomes found first rather than every one that exists.
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 259 | 82–160 | 38 | |
| 8.5 | 259 | 82–160 | 38 | |
| 8.4 | 259 | 82–160 | 38 | 6 fewer instructions than PHP 8.3 |
| 8.3 | 265 | 82–166 | 38 | |
| 8.2 | 265 | 82–166 | 38 | |
| 8.1 | 265 | 82–166 | 38 | 1 fewer instruction than PHP 7.4 |
| 7.4 | 266 | 82–166 | 38 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Hooks and filters fired · 1
One hook fires while wp_list_categories() runs, in this order:
- apply_filters( wp_list_categories )filterline 681 (+143 into the body)
Filters the HTML output of a taxonomy list.
Uses · 20
- __()Retrieves the translation of $text.
- wp_parse_args()Merges user defined arguments into defaults array.
- wp_parse_id_list()Cleans up an array, comma- or space-separated list of IDs.
- taxonomy_exists()Determines whether the taxonomy name exists.
- get_categories()Retrieves a list of category objects.
- esc_attr()Escaping for HTML attributes.
- get_taxonomy()Retrieves the taxonomy object of $taxonomy.
- get_post_type_object()Retrieves a post type object by name.
- get_post_type_archive_link()Retrieves the permalink for a post type archive.
- get_option()Retrieves an option value based on an option name.
- get_permalink()Retrieves the full permalink for the current post or post ID.
- home_url()Retrieves the URL for the current site where the front end is accessible.
Show all 20
- esc_url()Checks and cleans a URL.
- is_category()Determines whether the query is for an existing category archive page.
- is_tax()Determines whether the query is for an existing custom taxonomy archive page.
- is_tag()Determines whether the query is for an existing tag archive page.
- get_queried_object()Retrieves the currently queried object.
- get_queried_object_id()Retrieves the ID of the currently queried object.
- walk_category_tree()Retrieves HTML list content for category list.
- apply_filters()Calls the callback functions that have been added to a filter hook.
Used by · 3
- WP_Widget_Categories::widget()Outputs the content for the current Categories widget instance.
- render_block_core_categories()Renders the `core/categories` block on server.
- wp_list_cats()Lists categories.
Source code
function wp_list_categories( $args = '' ) { $defaults = array( 'child_of' => 0, 'current_category' => 0, 'depth' => 0, 'echo' => 1, 'exclude' => '', 'exclude_tree' => '', 'feed' => '', 'feed_image' => '', 'feed_type' => '', 'hide_empty' => 1, 'hide_title_if_empty' => false, 'hierarchical' => true, 'order' => 'ASC', 'orderby' => 'name', 'separator' => '<br />', 'show_count' => 0, 'show_option_all' => '', 'show_option_none' => __( 'No categories' ), 'style' => 'list', 'taxonomy' => 'category', 'title_li' => __( 'Categories' ), 'use_desc_for_title' => 0, ); $parsed_args = wp_parse_args( $args, $defaults ); if ( ! isset( $parsed_args['pad_counts'] ) && $parsed_args['show_count'] && $parsed_args['hierarchical'] ) { $parsed_args['pad_counts'] = true; } // Descendants of exclusions should be excluded too. if ( $parsed_args['hierarchical'] ) { $exclude_tree = array(); if ( $parsed_args['exclude_tree'] ) { $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $parsed_args['exclude_tree'] ) ); } if ( $parsed_args['exclude'] ) { $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $parsed_args['exclude'] ) ); } $parsed_args['exclude_tree'] = $exclude_tree; $parsed_args['exclude'] = ''; } if ( ! isset( $parsed_args['class'] ) ) { $parsed_args['class'] = ( 'category' === $parsed_args['taxonomy'] ) ? 'categories' : $parsed_args['taxonomy']; } if ( ! taxonomy_exists( $parsed_args['taxonomy'] ) ) { return false; } $show_option_all = $parsed_args['show_option_all']; $show_option_none = $parsed_args['show_option_none']; $categories = get_categories( $parsed_args ); $output = ''; if ( $parsed_args['title_li'] && 'list' === $parsed_args['style'] && ( ! empty( $categories ) || ! $parsed_args['hide_title_if_empty'] ) ) { $output = '<li class="' . esc_attr( $parsed_args['class'] ) . '">' . $parsed_args['title_li'] . '<ul>'; } if ( empty( $categories ) ) { if ( ! empty( $show_option_none ) ) { if ( 'list' === $parsed_args['style'] ) { $output .= '<li class="cat-item-none">' . $show_option_none . '</li>'; } else { $output .= $show_option_none; } } } else { if ( ! empty( $show_option_all ) ) {Changelog
Introduced in 4.4.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
current_category argument was modified to optionally accept an array of values.from the docblockhide_title_if_empty and separator arguments.from the docblockAbout this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/category-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.