WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#10773 closed defect (bug) (fixed)

Blank submenu entry created when register_taxonomy arg "label" set to false.

Reported by: batmoo Owned by: dd32
Milestone: 3.0 Priority: low
Severity: minor Version: 2.8.4
Component: Taxonomy Keywords: needs-patch
Focuses: Cc:

Description

Setting label as false (as suggested in ##9945) when calling register_taxonomy creates a blank submenu entry under "Posts". The entry has a valid link that goes to a "Tags" page for the registered taxonomy; this page should be accessible.

Sample function call:
register_taxonomy( 'test', 'post', array('hierarchical' => false, 'update_count_callback' => '_update_post_term_count', 'label' => false, 'query_var' =>false, 'rewrite' => false) );

Change needs to be made in wp-admin/menu.php to check if the taxonomy has a valid label entry before creating submenu item.

Attachments (1)

menu.diff (536 bytes) - added by batmoo 5 years ago.
Patch

Download all attachments as: .zip

Change History (11)

comment:1 batmoo5 years ago

  • Owner changed from filosofo to batmoo
  • Status changed from new to accepted

comment:2 dd325 years ago

  • Keywords needs-patch added
  • Milestone changed from Unassigned to 2.9

batmoo: Are you going to supply a patch?

comment:3 batmoo5 years ago

Yep, have a patch ready, just need to create the diff.

batmoo5 years ago

Patch

comment:4 batmoo5 years ago

  • Keywords has-patch added; needs-patch removed

Patch added.

comment:5 westi5 years ago

  • Cc westi added
  • Keywords needs-patch added; has-patch removed

Setting the label to false sounds like a horrid hack here.

I think it would be better to improve the function as you suggested in #9945 to give the code registering the plugin more control.

It would also probably be good to move the defaults for label out to the registration function to make it obvious it can be overloaded.

Do you fancy working up a patch for this?

comment:6 azaozz4 years ago

  • Milestone changed from 2.9 to Future Release

comment:7 dd324 years ago

  • Milestone changed from Future Release to 3.0
  • Owner changed from batmoo to dd32

comment:8 dd324 years ago

(In [13216]) First pass at giving taxonomies a show_ui param. See #10773

comment:9 dd324 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

Re-open if there are any remaining issues regarding show_ui w/ taxonomies.

comment:10 Denis-de-Bernardy4 years ago

see also #10437, which I'm itching to close as fixed dup.

Note: See TracTickets for help on using tickets.