Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#34491 closed enhancement (fixed)

Introduce a 'publicly_queryable' argument to register_taxonomy

Reported by: chouby's profile Chouby Owned by: boonebgorges's profile boonebgorges
Milestone: 4.5 Priority: normal
Severity: normal Version: 4.4
Component: Taxonomy Keywords: has-patch has-unit-tests needs-docs
Focuses: Cc:


Since #21949, it is no more possible to query non-public taxonomies.

Instead of controlling whether a taxonomy can be queried directly with the public argument, I propose to handle this the same way it is already done for post types.

A new argument publicly_queryable controls whether it is possible to query the taxonomy on front end. The public argument controls the default value for publicly_queryable, show_ui, and show_in_nav_menus.

Attachments (3)

34491.patch (6.3 KB) - added by Chouby 8 years ago.
34491.2.patch (7.5 KB) - added by Chouby 8 years ago.
34491.3.patch (7.8 KB) - added by Chouby 7 years ago.

Download all attachments as: .zip

Change History (14)

8 years ago

#1 @Chouby
8 years ago

  • Keywords has-patch added

#2 @johnbillion
8 years ago

  • Keywords needs-unit-tests dev-feedback needs-testing added
  • Milestone changed from Awaiting Review to 4.4
  • Owner set to boonebgorges
  • Status changed from new to assigned

#3 @boonebgorges
8 years ago

  • Keywords 4.5-early added; dev-feedback needs-testing removed
  • Milestone changed from 4.4 to Future Release

Thanks for the patch, Chouby. It would be nice to have a few tests demonstrating how publicly_queryable gets its default value from public.

8 years ago

#4 @Chouby
8 years ago

  • Keywords has-unit-tests added; needs-unit-tests removed

These are my first unit tests so I am not sure that they are pertinent enough.

#5 @boonebgorges
7 years ago

  • Keywords 4.5-early removed
  • Milestone changed from Future Release to 4.5

#6 @boonebgorges
7 years ago

  • Keywords needs-refresh added

7 years ago

#7 @Chouby
7 years ago

  • Keywords needs-refresh removed

#8 @boonebgorges
7 years ago

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

In 36525:

Introduce publicly_queryable taxonomy argument.

Taxonomies registered as publicly_queryable can be queried as taxonomy

If not provided explicitly, the value of publicly_queryable is inherited
from public.

Props Chouby.
Fixes #34491.

#9 @DrewAPicture
7 years ago

  • Keywords needs-docs added
  • Resolution fixed deleted
  • Status changed from closed to reopened

I do believe we need a changelog entry for this new argument :-)

#10 @boonebgorges
7 years ago

Whoops. Usually I remember.

#11 @boonebgorges
7 years ago

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

In 36564:

Add changelog entry for publicly_queryable argument in register_taxonomy().

Missed in [36525].

Fixes #34491.

Note: See TracTickets for help on using tickets.