WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 9 months ago

#33530 new defect (bug)

get_taxonomy_labels() conflicts with the admin bar on archive/taxonomy page

Reported by: drebbits.web Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.3
Component: Taxonomy Keywords: close
Focuses: template Cc:

Description

The get_taxonomy_labels() is in conflict with the edit term/taxonomy link on the admin bar on archive/taxonomy page. The object has been casted into array in the process but it never goes back to being object after.

Change History (7)

#1 @SergeyBiryukov
2 years ago

  • Keywords reporter-feedback added

Hi @drebbits.web, welcome to Trac!

Could you clarify which object you are referring to and provide the steps to reproduce the issue on a clean install?

#2 @drebbits.web
2 years ago

Thanks @SergeyBiryukov!

I'm referring to $tax object that is used both in taxonomy.php line 488 and admin-bar.php line 580.

To replicate the issue, add $taxonomy_labels = get_taxonomy_labels( get_taxonomy('category') );in the archive.php of twentyfifteen theme. When you're logged-in, you should see a PHP notice in the admin-bar.php and it breaks the edit taxonomy link that is supposed to be in the admin bar.

Last edited 2 years ago by drebbits.web (previous) (diff)

#3 @drebbits.web
2 years ago

  • Keywords reporter-feedback removed

#4 @drebbits.web
2 years ago

  • Keywords dev-feedback added

#5 @Compute
2 years ago

+1

Also discovered this issue. Seems like there is some type casting from object to array (back and forth) inside of get_taxonomy_labels() and _get_custom_object_labels().

This ticket was mentioned in Slack in #core by drebbits. View the logs.


2 years ago

#7 @swissspidy
9 months ago

  • Keywords close added; dev-feedback removed

I cannot reproduce this issue with the steps provided earlier. get_taxonomy_labels() and _get_custom_object_labels() always cast to an object before returning the labels.

Note: See TracTickets for help on using tickets.