mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Taxonomy: Use a consistent check for the $rewrite['hierarchical'] parameter.
This avoids a "Trying to access array offset on value of type bool" PHP warning in `get_term_link()` if the `$rewrite` parameter of `register_taxonomy()` is set as `false`. Props Tkama, SergeyBiryukov. Fixes #52882. git-svn-id: https://develop.svn.wordpress.org/trunk@50565 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -4475,7 +4475,7 @@ function get_term_link( $term, $taxonomy = '' ) {
|
||||
}
|
||||
$termlink = home_url( $termlink );
|
||||
} else {
|
||||
if ( $t->rewrite['hierarchical'] ) {
|
||||
if ( ! empty( $t->rewrite['hierarchical'] ) ) {
|
||||
$hierarchical_slugs = array();
|
||||
$ancestors = get_ancestors( $term->term_id, $taxonomy, 'taxonomy' );
|
||||
foreach ( (array) $ancestors as $ancestor ) {
|
||||
|
||||
Reference in New Issue
Block a user