Make WordPress Core

Opened 7 months ago

Last modified 7 months ago

#61225 assigned enhancement

Add a new hook to allow custom buttons next to "Add new post" button

Reported by: siddiquesaad's profile siddiquesaad Owned by: siddiquesaad's profile siddiquesaad
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch
Focuses: ui, administration Cc:

Description

There's no way to add a personalized button next to the "Add New <Post Type>" button on the edit screen in WP-Admin. Sometimes, customization is needed, like adding an "Import" button to be programmatically added to a custom post type. It'll immensely help to add a do_action here:

if ( current_user_can( $post_type_object->cap->create_posts ) ) {
	echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="page-title-action">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
}

Thanks

Change History (1)

This ticket was mentioned in PR #6556 on WordPress/wordpress-develop by @siddiquesaad.


7 months ago
#1

  • Keywords has-patch added

I recently encountered an issue where adding a button such as "Import" was impossible without JS manipulation (which is hackish). Adding this do_action will allow me and other users to dynamically add a button on the screen for custom post types.

Trac ticket: https://core.trac.wordpress.org/ticket/61225#ticket

Note: See TracTickets for help on using tickets.