diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index b0d053f648..be1faaeba5 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -980,6 +980,7 @@ function get_term( $term, $taxonomy = '', $output = OBJECT, $filter = 'raw' ) { // Ensure for filters that this is not empty. $taxonomy = $_term->taxonomy; + $old_term = $_term; /** * Filters a taxonomy term object. * @@ -1019,7 +1020,9 @@ function get_term( $term, $taxonomy = '', $output = OBJECT, $filter = 'raw' ) { } // Sanitize term, according to the specified filter. - $_term->filter( $filter ); + if ( $_term !== $old_term || $_term->filter !== $filter ) { + $_term->filter( $filter ); + } if ( ARRAY_A === $output ) { return $_term->to_array(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 1b7ea47ecb..0287fdfa95 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.4-alpha-56649'; +$wp_version = '6.4-alpha-56650'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.