Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#21948 closed enhancement (fixed)

Allow filtering post type labels

Reported by: scribu's profile scribu Owned by: nacin's profile nacin
Milestone: 3.5 Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch commit needs-codex
Focuses: Cc:

Description (last modified by scribu)

Follow-up from #21944

22:49 <nacin> just needs a filter in get_post_type_labels()
22:51 <nacin> there's a separate API for basically everything else - query variables, rewrite rules, supports, taxonomies, meta boxes, menus

Attachments (4)

21948.diff (617 bytes) - added by scribu 12 years ago.
pancakes.php (272 bytes) - added by scribu 12 years ago.
21948.2.diff (647 bytes) - added by scribu 12 years ago.
"post_type_labels_{$post_type}"
pancakes.2.php (210 bytes) - added by scribu 12 years ago.

Download all attachments as: .zip

Change History (15)

#1 @scribu
12 years ago

  • Description modified (diff)

@scribu
12 years ago

@scribu
12 years ago

#2 @scribu
12 years ago

  • Keywords has-patch added

21948.diff introduces the 'post_type_labels' filter.

pancakes.php shows one potential usage.

#3 @DrewAPicture
12 years ago

  • Cc xoodrew@… added

#4 @scribu
12 years ago

  • Milestone changed from Awaiting Review to 3.5

@scribu
12 years ago

"post_type_labels_{$post_type}"

@scribu
12 years ago

#5 @scribu
12 years ago

21948.2.diff introduces "post_type_labels_{$post_type}" instead, since you'll have a specific set of post types that you'll want to target.

#7 @jamescollins
12 years ago

+1 to this idea.

My Custom Post Type Editor plugin currently has to override CPT labels after a CPT is registered by using the registered_post_type hook.

A filter before each CPT is registered would be much better.

#8 @nacin
12 years ago

  • Keywords commit added

#9 @nacin
12 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In [22164]:

Add post_type_labels_{$post_type} filter. props scribu. fixes #21948.

#10 @johnbillion
12 years ago

Kinda sorta related: #18710, #18714

#11 @DrewAPicture
12 years ago

  • Keywords needs-codex added
Note: See TracTickets for help on using tickets.