Make WordPress Core


Ignore:
Timestamp:
03/23/2021 01:53:50 PM (4 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-query.php

    r49946 r50565  
    11191119                );
    11201120
    1121                 if ( isset( $t->rewrite['hierarchical'] ) && $t->rewrite['hierarchical'] ) {
     1121                if ( ! empty( $t->rewrite['hierarchical'] ) ) {
    11221122                    $q[ $t->query_var ] = wp_basename( $q[ $t->query_var ] );
    11231123                }
Note: See TracChangeset for help on using the changeset viewer.