WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 17 months ago

#35097 new enhancement

New filter: `edit_post_type_title`

Reported by: sebastian.pisula Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch 2nd-opinion
Focuses: Cc:

Description

Filter in edit.php to filter title. Why ?

I filter this page by term and I want have title of current term

edit.php?post_type=investor-day&funds-categories=title

Attachments (1)

35097.patch (1.2 KB) - added by sebastian.pisula 3 years ago.

Download all attachments as: .zip

Change History (6)

#1 @sebastian.pisula
3 years ago

  • Keywords has-patch added

#2 @swissspidy
3 years ago

Hi there

Two questions:

  • Doesn't the post_type_labels_{$post_type} filter help here?
  • Why limit this to edit.php? What about editing terms?

#3 @sebastian.pisula
3 years ago

  1. I can't because taxonomy not exists yet. I use get_term_by and this function return false.
  2. Because I want filter title in page with posts list.

#4 @SergeyBiryukov
3 years ago

A workaround:

function wp35097_change_post_type_title_on_edit_screen() {
	global $post_type_object;
	$post_type_object->labels->name = 'My Custom Name';
}
add_action( 'admin_head-edit.php', 'wp35097_change_post_type_title_on_edit_screen' );

#5 @swissspidy
17 months ago

  • Keywords 2nd-opinion added

Why limit this to edit.php? What about editing terms?

What about a general function for printing the admin titles that can be filtered?

Note: See TracTickets for help on using tickets.