WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#34554 closed enhancement (fixed)

Add a `taxonomy_labels_{$taxonomy}` filter

Reported by: flixos90 Owned by: johnbillion
Milestone: 4.4 Priority: normal
Severity: normal Version: 3.5
Component: Taxonomy Keywords: has-patch
Focuses: Cc:

Description

It would be straightforward and helpful in some cases to add a new filter taxonomy_labels_{$taxonomy} (where {$taxonomy} is the taxonomy slug) to the function get_taxonomy_labels() so that they are filtered, just like in its post type equivalent get_post_type_labels().

Attachments (1)

34554.patch (1.1 KB) - added by flixos90 5 years ago.
Patch which adds the filter

Download all attachments as: .zip

Change History (5)

@flixos90
5 years ago

Patch which adds the filter

#1 @flixos90
5 years ago

  • Focuses administration added
  • Keywords has-patch dev-feedback added

#2 @johnbillion
5 years ago

  • Focuses administration removed
  • Keywords dev-feedback removed
  • Milestone changed from Awaiting Review to Future Release

Agreed.

#3 @johnbillion
5 years ago

  • Milestone changed from Future Release to 4.4
  • Owner set to johnbillion
  • Status changed from new to reviewing
  • Version set to 3.5

The post type labels filter was introduced in #21948.

#4 @DrewAPicture
5 years ago

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

In 35504:

Taxonomy: Introduce the dynamic taxonomy_labels_{$taxonomy} filter, which can be used to manipulate the labels for a given taxonomy.

The addition of this hook brings parity with the earlier-introduced post_type_labels_{$post_type} filter, which allows for similarly manipulating labels for a given post type.

Note: It isn't possible to unset or remove default labels via either of these hooks, only to overwrite. This is because WordPress relies on defaults being set for use in various UIs and admin experiences.

Props flixos90.
Fixes #34554.

Note: See TracTickets for help on using tickets.