Make WordPress Core

Opened 16 months ago

Closed 16 months ago

Last modified 15 months ago

#57587 closed defect (bug) (invalid)

Method get_term_link() isn't type safe - (Attempt to read property "query_var" on bool)

Reported by: 1benk1's profile 1benk1 Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.1.1
Component: Taxonomy Keywords:
Focuses: Cc:


Within wp-includes/taxonomy.php the method get_term_link() is dropping following error in the monitoring:

PHP Warning: Attempt to read property "query_var" on bool in /wp-includes/taxonomy.php on line 4590 (

Change History (7)

#1 @costdev
16 months ago

  • Component changed from General to Taxonomy

#2 @costdev
16 months ago

  • Keywords reporter-feedback added

Hi @1benk1, welcome to Trac and thanks for opening this ticket!

Can you please provide steps to reproduce this warning? Thanks!

#3 @1benk1
16 months ago

Unfortunately, not in the moment. We run a large website with WordPress and this message popped up in our monitoring immediately after a recent switch to PHP 8.1.

I suspect that the call to get_taxonomy() in line 4584 ( returns false and access to a boolean is not allowed, as is the case in line 4590.

I'm trying to figure out under what circumstances the return value of get_taxonomy() in this method can be false and reproduce the whole thing.

Actually, the only conceivable case is that a WP_Term object is passed to get_term_link() whose taxonomy property does not really exist.

#4 @1benk1
16 months ago

  • Resolution set to wontfix
  • Status changed from new to closed

After some debugging I found out that $term is not a WP_Term object, but the MultipleAuthors\Classes\Objects\Author class of a plugin (

We used get_term_link() with the return value of get_queried_object() ( and the documenation of this Method is suggesting, that the return values can only be WP_Term|WP_Post_Type|WP_Post|WP_User|null.

This report can be closed...

#5 @knutsp
16 months ago

  • Keywords reporter-feedback removed
  • Resolution wontfix deleted
  • Status changed from closed to reopened
  • Summary changed from Method get_term_link() isn't type save - (Attempt to read property "query_var" on bool) to Method get_term_link() isn't type safe - (Attempt to read property "query_var" on bool)

#6 @knutsp
16 months ago

  • Resolution set to invalid
  • Status changed from reopened to closed

#7 @SergeyBiryukov
15 months ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.