WordPress/wp-includes
Boone Gorges 17d32ebc8f Taxonomy: Ensure consistency of hide_empty in term queries when taxonomy is excluded.
When querying for terms in hierarchical categories using `hide_empty=true`,
results have historically included parent terms which are themselves
unattached to any objects (are "empty") but which have non-empty descendent
terms. Because this process involves walking the descendant tree, we avoid it
when we detect that the queried taxonomies are not hierarchical. (This
behavior was introduced in [5525].)

When the `taxonomy` parameter of `get_terms()` was made optional - see #35495,
[36614] - it affected the mechanism for avoiding unneccessary tree walks,
since there may not be any explicitly declared taxonomies to run through
`is_taxonomy_hierarchical()`. As a result, term queries excluding `taxonomy`
did not check descendants, and empty parents with non-empty children were not
included in `hide_empty` results.

We correct the behavior by crawling term descendants when the `taxonomy`
argument is absent, which means that we're querying for terms in all taxonomies.

Props smerriman.
Fixes #37728.
Built from https://develop.svn.wordpress.org/trunk@45888


git-svn-id: http://core.svn.wordpress.org/trunk@45699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-23 16:05:56 +00:00
..
blocks
certificates
css Multisite: Remove truncation to allow clearers identification of longer site names 2019-08-18 12:31:00 +00:00
customize Docs: Add missing description for $wp_locale global. 2019-08-04 01:46:55 +00:00
fonts
ID3
images
IXR
js Docs: Update @since tag for new JS functions and variables introduced in [45572]. 2019-08-20 22:54:55 +00:00
pomo Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes. 2019-07-02 23:42:58 +00:00
random_compat
Requests
rest-api REST API: Always return post types list in taxonomies endpoint response as an array. 2019-08-15 22:12:55 +00:00
SimplePie
sodium_compat
Text
theme-compat Coding Standards: Fix all WordPress.WhiteSpace.PrecisionAlignment issues. 2019-07-05 05:21:56 +00:00
widgets Widgets: Replace http with https in the link placeholder widget image 2019-08-09 17:06:55 +00:00
admin-bar.php Docs: Add missing description for $wp_query and $wp_the_query globals. 2019-08-04 01:59:56 +00:00
atomlib.php
author-template.php Docs: Improve documentation for various feed link functions and filters. 2019-08-11 17:21:57 +00:00
blocks.php
bookmark-template.php Taxonomy: Fix deprecated calls to get_terms(). 2019-08-03 03:35:56 +00:00
bookmark.php Coding Standards: Rename $r variable used with wp_parse_args() to $parsed_args for clarity. 2019-07-25 00:48:58 +00:00
cache.php
canonical.php Docs: Add missing description for $wp_query and $wp_the_query globals. 2019-08-04 01:59:56 +00:00
capabilities.php REST API: Prevent deletion of post revisions. 2019-08-15 22:01:55 +00:00
category-template.php Docs: Add missing description for $wp_rewrite global. 2019-08-04 01:19:56 +00:00
category.php Taxonomy: Fix deprecated calls to get_terms(). 2019-08-03 03:35:56 +00:00
class-feed.php
class-http.php Coding Standards: Rename $r variable used with wp_parse_args() to $parsed_args for clarity. 2019-07-25 00:48:58 +00:00
class-IXR.php
class-json.php PHP 7.4 compatibility fix / accessing arrays/string using curly brace syntax 2019-08-03 20:21:55 +00:00
class-oembed.php Coding Standards: Move wp-includes/class-oembed.php to wp-includes/class-wp-oembed.php. 2019-07-19 04:32:57 +00:00
class-phpass.php
class-phpmailer.php
class-pop3.php PHP 7.4 compatibility fix / accessing arrays/string using curly brace syntax 2019-08-03 20:21:55 +00:00
class-requests.php
class-simplepie.php
class-smtp.php
class-snoopy.php
class-walker-category-dropdown.php
class-walker-category.php Taxonomy: Fix deprecated calls to get_terms(). 2019-08-03 03:35:56 +00:00
class-walker-comment.php
class-walker-nav-menu.php Menus: Set better default for $args parameter in Walker_Nav_Menu methods, to match the documented parameter type. 2019-06-14 11:26:52 +00:00
class-walker-page-dropdown.php
class-walker-page.php Menus: Use esc_url() for the href value of page link attributes in Walker_Page::start_el(), for consistency with Walker_Nav_Menu and Walker_Category. 2019-03-21 10:45:51 +00:00
class-wp-admin-bar.php Docs: Add a missing return type. 2019-08-16 19:35:58 +00:00
class-wp-ajax-response.php Coding Standards: Rename $r variable used with wp_parse_args() to $parsed_args for clarity. 2019-07-25 00:48:58 +00:00
class-wp-block-parser.php
class-wp-block-type-registry.php
class-wp-block-type.php
class-wp-comment-query.php Coding Standards: Fix all WordPress.DB.PreparedSQLPlaceholders issues. 2019-07-05 05:43:55 +00:00
class-wp-comment.php
class-wp-customize-control.php
class-wp-customize-manager.php Docs: Add missing description for $wpdb, $wp_db_version, and $wp_current_db_version globals. 2019-08-04 01:12:56 +00:00
class-wp-customize-nav-menus.php Taxonomy: Fix deprecated calls to get_terms(). 2019-08-03 03:35:56 +00:00
class-wp-customize-panel.php Docs: Remove @static notations from property DocBlocks in wp-admin/* and wp-includes/* classes. 2018-02-25 20:32:30 +00:00
class-wp-customize-section.php
class-wp-customize-setting.php
class-wp-customize-widgets.php Customize: In WP_Customize_Widgets::capture_filter_pre_update_option(), return the filtered value instead of null when bailing early for ignored options. 2019-07-16 21:33:57 +00:00
class-wp-date-query.php Date/Time: Use wp_timezone() in WP_Date_Query::build_mysql_datetime() to address timezone issues. 2019-08-22 03:11:55 +00:00
class-wp-dependency.php Coding Standards: Fix instances of WordPress.PHP.NoSilencedErrors.Discouraged. 2019-07-09 05:45:58 +00:00
class-wp-editor.php PHP 7.4 compatibility fix / accessing arrays/string using curly brace syntax 2019-08-03 20:21:55 +00:00
class-wp-embed.php Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes. 2019-07-02 23:42:58 +00:00
class-wp-error.php
class-wp-fatal-error-handler.php
class-wp-feed-cache-transient.php
class-wp-feed-cache.php
class-wp-hook.php Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes. 2019-07-02 23:42:58 +00:00
class-wp-http-cookie.php Docs: Correct @type annotation for WP_HTTP_Cookie::$expires. 2019-08-05 07:56:56 +00:00
class-wp-http-curl.php Docs: Correct @type annotation for WP_Http_Curl properties. 2019-08-05 08:12:56 +00:00
class-wp-http-encoding.php Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes. 2019-07-02 23:42:58 +00:00
class-wp-http-ixr-client.php
class-wp-http-proxy.php
class-wp-http-requests-hooks.php Coding Standards: Mark the handful of hook names with uppercase characters or hyphens as ignored. 2019-07-05 01:45:56 +00:00
class-wp-http-requests-response.php
class-wp-http-response.php Coding Standards: Fix/ignore the WordPress.NamingConventions.ValidFunctionName violations. 2019-07-01 08:01:57 +00:00
class-wp-http-streams.php Coding Standards: Rename $r variable used with wp_parse_args() to $parsed_args for clarity. 2019-07-25 00:48:58 +00:00
class-wp-image-editor-gd.php Coding Standards: Fix instances of WordPress.PHP.NoSilencedErrors.Discouraged. 2019-07-09 05:45:58 +00:00
class-wp-image-editor-imagick.php Coding Standards: Fix instances of WordPress.PHP.NoSilencedErrors.Discouraged. 2019-07-09 05:45:58 +00:00
class-wp-image-editor.php Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes. 2019-07-02 23:42:58 +00:00
class-wp-list-util.php Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes. 2019-07-02 23:42:58 +00:00
class-wp-locale-switcher.php Docs: Add missing description for $wp_locale global. 2019-08-04 01:46:55 +00:00
class-wp-locale.php I18N: Use RTL stylesheets when running from /src. 2019-07-27 14:17:57 +00:00
class-wp-matchesmapregex.php
class-wp-meta-query.php Coding Standards: Fix all WordPress.DB.PreparedSQLPlaceholders issues. 2019-07-05 05:43:55 +00:00
class-wp-metadata-lazyloader.php
class-wp-network-query.php Docs: Add missing description for $wpdb, $wp_db_version, and $wp_current_db_version globals. 2019-08-04 01:12:56 +00:00
class-wp-network.php
class-wp-oembed-controller.php Coding Standards: Move wp-includes/class-oembed.php to wp-includes/class-wp-oembed.php. 2019-07-19 04:32:57 +00:00
class-wp-oembed.php General: First pass at replacing Codex URLs with a corresponding HelpHub or DevHub article. 2019-07-25 22:45:57 +00:00
class-wp-paused-extensions-storage.php
class-wp-post-type.php Docs: Add missing description for $wp_rewrite global. 2019-08-04 01:19:56 +00:00
class-wp-post.php
class-wp-query.php Docs: Add missing description for $post global. 2019-08-04 12:28:56 +00:00
class-wp-recovery-mode-cookie-service.php Bootstrap/Load: Set expiration of the recovery mode cookie to the same amount of time for which the token in it is valid: a week by default. 2019-06-17 19:17:54 +00:00
class-wp-recovery-mode-email-service.php
class-wp-recovery-mode-key-service.php
class-wp-recovery-mode-link-service.php
class-wp-recovery-mode.php Bootstrap/Load: Return a 403 error code when the recovery mode cookie is invalid or expired, or the exit recovery mode nonce check failed. 2019-06-17 18:37:55 +00:00
class-wp-rewrite.php Docs: Add missing description for $wp global. 2019-08-04 01:28:55 +00:00
class-wp-role.php
class-wp-roles.php
class-wp-session-tokens.php
class-wp-simplepie-file.php
class-wp-simplepie-sanitize-kses.php
class-wp-site-query.php Docs: Add missing description for $wpdb, $wp_db_version, and $wp_current_db_version globals. 2019-08-04 01:12:56 +00:00
class-wp-site.php
class-wp-tax-query.php Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes. 2019-07-02 23:42:58 +00:00
class-wp-taxonomy.php Docs: Add missing description for $wp global. 2019-08-04 01:28:55 +00:00
class-wp-term-query.php Taxonomy: Ensure consistency of hide_empty in term queries when taxonomy is excluded. 2019-08-23 16:05:56 +00:00
class-wp-term.php
class-wp-text-diff-renderer-inline.php
class-wp-text-diff-renderer-table.php Accessibility: Improve the differences between revisions. 2019-08-03 15:46:54 +00:00
class-wp-theme.php Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes. 2019-07-02 23:42:58 +00:00
class-wp-user-meta-session-tokens.php Docs: Add @see WP_Session_Tokens to the WP_User_Meta_Session_Tokens docblock. 2019-01-09 05:04:50 +00:00
class-wp-user-query.php Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes. 2019-07-02 23:42:58 +00:00
class-wp-user-request.php Privacy tools: 2019-06-10 23:54:53 +00:00
class-wp-user.php Code Modernisation: Introduce the spread operator in WP_User. 2019-07-11 23:48:56 +00:00
class-wp-walker.php Code Modernisation: Revert [45624]. 2019-07-15 07:04:59 +00:00
class-wp-widget-factory.php
class-wp-widget.php Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes. 2019-07-02 23:42:58 +00:00
class-wp-xmlrpc-server.php Pings/Trackbacks: In wp_xmlrpc_server::pingback_ping(), strip inline JS and CSS while trying to figure out the pingback context. 2019-08-17 13:59:55 +00:00
class-wp.php Docs: Add missing description for $wp_query and $wp_the_query globals. 2019-08-04 01:59:56 +00:00
class.wp-dependencies.php Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes. 2019-07-02 23:42:58 +00:00
class.wp-scripts.php Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes. 2019-07-02 23:42:58 +00:00
class.wp-styles.php Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes. 2019-07-02 23:42:58 +00:00
comment-template.php Comments: Include post permalink in comment reply link. 2019-08-13 05:09:56 +00:00
comment.php Privacy: Add descriptions for sections in a personal data export file. 2019-08-18 02:07:57 +00:00
compat.php Code Modernisation: Document when the Hash polyfills can be removed. 2019-07-15 05:14:55 +00:00
cron.php General: First pass at replacing Codex URLs with a corresponding HelpHub or DevHub article. 2019-07-25 22:45:57 +00:00
date.php Coding Standards: Move wp-includes/date.php to wp-includes/class-wp-date-query.php. 2019-07-25 23:31:56 +00:00
default-constants.php Coding Standards: Fix instances of WordPress.PHP.NoSilencedErrors.Discouraged. 2019-07-09 05:45:58 +00:00
default-filters.php Site health: Introduce view_site_health_checks capability. 2019-06-10 07:42:52 +00:00
default-widgets.php
deprecated.php Docs: Add missing description for $wpdb, $wp_db_version, and $wp_current_db_version globals. 2019-08-04 01:12:56 +00:00
embed-template.php
embed.php
error-protection.php
feed-atom-comments.php Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes. 2019-07-02 23:42:58 +00:00
feed-atom.php
feed-rdf.php
feed-rss2-comments.php Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes. 2019-07-02 23:42:58 +00:00
feed-rss2.php
feed-rss.php
feed.php Feeds: Introduce the get_self_link() function. 2019-08-09 01:31:56 +00:00
formatting.php Date/Time: Rewrite and simplify get_gmt_from_date(), get_date_from_gmt(), and iso8601_to_datetime() using wp_timezone(). 2019-08-23 11:03:56 +00:00
functions.php Date/Time: Revert unintended changes from [45882]. 2019-08-23 01:16:53 +00:00
functions.wp-scripts.php
functions.wp-styles.php
general-template.php Taxonomy: In feed_links_extra() and get_the_archive_title(), make sure the queried taxonomy term exists before accessing its properties. 2019-08-16 00:24:54 +00:00
http.php Coding Standards: Fix instances of WordPress.PHP.NoSilencedErrors.Discouraged. 2019-07-09 05:45:58 +00:00
kses.php Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes. 2019-07-02 23:42:58 +00:00
l10n.php Docs: Add missing description for $wp_locale_switcher global. 2019-08-04 01:47:55 +00:00
link-template.php Docs: Improve documentation for various feed link functions and filters. 2019-08-11 17:21:57 +00:00
load.php Bootstrap/Load: Change "Insufficient Requirements" wp_die() heading to "Requirements Not Met", which is more appropriate for the context it's used in. 2019-08-08 12:54:56 +00:00
locale.php
media-template.php Accessibility: Fix the alt attribute of the Gallery images within the Classic Editor. 2019-08-03 11:36:53 +00:00
media.php Privacy: Add descriptions for sections in a personal data export file. 2019-08-18 02:07:57 +00:00
meta.php Docs: Clarify custom-fields support requirement for viewing custom post meta in REST API. 2019-08-13 01:51:56 +00:00
ms-blogs.php Networks and Sites: Improve documentation and variable naming in switch_to_blog() and restore_current_blog(). 2019-08-14 14:29:56 +00:00
ms-default-constants.php
ms-default-filters.php
ms-deprecated.php Docs: Add missing description for $wpdb, $wp_db_version, and $wp_current_db_version globals. 2019-08-04 01:12:56 +00:00
ms-files.php
ms-functions.php Docs: Add missing description for $wpdb, $wp_db_version, and $wp_current_db_version globals. 2019-08-04 01:12:56 +00:00
ms-load.php I18N: Update translator comments after [45674]. 2019-07-25 22:52:56 +00:00
ms-network.php
ms-settings.php
ms-site.php
nav-menu-template.php Docs: Add missing description for $wp_query and $wp_the_query globals. 2019-08-04 01:59:56 +00:00
nav-menu.php Taxonomy: Fix deprecated calls to get_terms(). 2019-08-03 03:35:56 +00:00
option.php Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes. 2019-07-02 23:42:58 +00:00
pluggable-deprecated.php
pluggable.php Docs: Improve documentation for wp_set_auth_cookie() and related functions. 2019-08-17 13:23:55 +00:00
plugin.php General: First pass at replacing Codex URLs with a corresponding HelpHub or DevHub article. 2019-07-25 22:45:57 +00:00
post-formats.php Docs: Add missing description for $wp_rewrite global. 2019-08-04 01:19:56 +00:00
post-template.php Docs: Add missing description for $wp_query and $wp_the_query globals. 2019-08-04 01:59:56 +00:00
post-thumbnail-template.php Docs: Add missing description for $wp_query and $wp_the_query globals. 2019-08-04 01:59:56 +00:00
post.php Date/Time: In wp_insert_post(), when checking the post date to set future or publish status, use string comparison to work around far future dates (year 2038+) on 32-bit systems. 2019-08-19 15:50:56 +00:00
query.php Docs: Add missing description for $wp_query and $wp_the_query globals. 2019-08-04 01:59:56 +00:00
registration-functions.php
registration.php
rest-api.php REST API: Clarify arguments passed to rest route get & update callbacks. 2019-08-15 20:04:55 +00:00
revision.php Coding Standards: Fix all WordPress.CodeAnalysis.AssignmentInCondition issues. 2019-07-05 03:14:56 +00:00
rewrite.php Docs: Add missing description for $wp global. 2019-08-04 01:28:55 +00:00
rss-functions.php
rss.php
script-loader.php Docs: Add missing description for $current_screen global. 2019-08-04 02:03:55 +00:00
session.php
shortcodes.php General: First pass at replacing Codex URLs with a corresponding HelpHub or DevHub article. 2019-07-25 22:45:57 +00:00
spl-autoload-compat.php Code Modernisation: Remove the SPL autoloader polyfill. 2019-07-15 05:11:56 +00:00
taxonomy.php Docs: Correct type for the $deprecated argument of get_terms(). 2019-08-21 16:27:55 +00:00
template-loader.php Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes. 2019-07-02 23:42:58 +00:00
template.php Docs: Add missing description for $post global. 2019-08-04 12:28:56 +00:00
theme.php Docs: Add missing description for $wp_locale global. 2019-08-04 01:46:55 +00:00
update.php Docs: Add missing description for $wpdb, $wp_db_version, and $wp_current_db_version globals. 2019-08-04 01:12:56 +00:00
user.php Users: Adjust [45708] to make sure wp_update_user() does not issue a WP_Error if a single site was previously set up as Multisite and there's still a spam field in the user table. 2019-08-22 01:53:55 +00:00
vars.php General: First pass at replacing Codex URLs with a corresponding HelpHub or DevHub article. 2019-07-25 22:45:57 +00:00
version.php Taxonomy: Ensure consistency of hide_empty in term queries when taxonomy is excluded. 2019-08-23 16:05:56 +00:00
widgets.php Widgets: Allow for short-circuiting widget output in the_widget() using the widget_display_callback filter, for consistency with output via a registered sidebar. 2019-08-14 23:03:55 +00:00
wlwmanifest.xml
wp-db.php Database: Use a strict comparison for has_filter() check in wpdb::placeholder_escape(). 2019-08-01 02:25:56 +00:00
wp-diff.php