Make WordPress Core

Opened 11 years ago

Closed 8 years ago

#33530 closed defect (bug) (worksforme)

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

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

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
11 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
11 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 11 years ago by drebbits.web (previous) (diff)

#3 @drebbits.web
11 years ago

  • Keywords reporter-feedback removed

#4 @drebbits.web
11 years ago

  • Keywords dev-feedback added

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


11 years ago

#7 @swissspidy
10 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
8 years ago

  • Milestone Awaiting Review
  • Resolution → worksforme
  • Status new → closed

I can't reproduce the issue either.

Note: See TracTickets for help on using tickets.