From 8728999a21501aa8b8afa1ad811917e3ff603a32 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Wed, 19 Dec 2018 03:47:59 +0000 Subject: [PATCH] Ensure that taxonomy name passed to `get_term()` filters is non-empty. Since [34997], the `$taxonomy` parameter of `get_term()` has been optional. This created cases where the `$taxonomy` parameter, used to concatenate names for some filters and passed as a parameter to others, would be empty. This changeset ensures that it's never empty by falling back on the `taxonomy` of the located term. Props dlh. Fixes #45698. git-svn-id: https://develop.svn.wordpress.org/trunk@44325 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/taxonomy.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index b46416bc16..87d8e0f202 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -840,6 +840,9 @@ function get_term( $term, $taxonomy = '', $output = OBJECT, $filter = 'raw' ) { return null; } + // Ensure for filters that this is not empty. + $taxonomy = $_term->taxonomy; + /** * Filters a taxonomy term object. *