Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#34491 closed enhancement (fixed)

Introduce a 'publicly_queryable' argument to register_taxonomy

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

Description

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 11 years ago.
34491.2.patch​ (7.5 KB ) - added by Chouby 11 years ago.
34491.3.patch​ (7.8 KB ) - added by Chouby 11 years ago.

Download all attachments as: .zip

Change History (14)

@Chouby
11 years ago

#1 @Chouby
11 years ago

  • Keywords has-patch added

#2 @johnbillion
11 years ago

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

#3 @boonebgorges
11 years ago

  • Keywords 4.5-early added; dev-feedback needs-testing removed
  • Milestone 4.4 → 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.

@Chouby
11 years ago

#4 @Chouby
11 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
11 years ago

  • Keywords 4.5-early removed
  • Milestone Future Release → 4.5

#6 @boonebgorges
11 years ago

  • Keywords needs-refresh added

@Chouby
11 years ago

#7 @Chouby
11 years ago

  • Keywords needs-refresh removed

#8 @boonebgorges
11 years ago

  • Resolution → fixed
  • Status assigned → closed

In 36525:

Introduce publicly_queryable taxonomy argument.

Taxonomies registered as publicly_queryable can be queried as taxonomy
archives.

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

Props Chouby.
Fixes #34491.

#9 @DrewAPicture
11 years ago

  • Keywords needs-docs added
  • Resolution fixed
  • Status closed → reopened

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

#10 @boonebgorges
11 years ago

Whoops. Usually I remember.

#11 @boonebgorges
11 years ago

  • Resolution → fixed
  • Status reopened → 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.