WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 7 months ago

#33530 closed defect (bug) (worksforme)

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

Reported by: drebbits.web Owned by:
Milestone: 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 (8)

#1 @SergeyBiryukov
4 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
4 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 4 years ago by drebbits.web (previous) (diff)

#3 @drebbits.web
4 years ago

  • Keywords reporter-feedback removed

#4 @drebbits.web
4 years ago

  • Keywords dev-feedback added

#5 @Compute
4 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.


4 years ago

#7 @swissspidy
3 years 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.

#8 @boonebgorges
7 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

I can't reproduce the issue either.

Note: See TracTickets for help on using tickets.