I have a custom post type called 'Bookmark'.
When users add a new Bookmark in the Admin, the title of the page is
Add a new Page
Is there a hook (filter) to change this title to
I have a custom post type called 'Bookmark'.
When users add a new Bookmark in the Admin, the title of the page is
Is there a hook (filter) to change this title to
When you're registering new post type with register_post_type
, you can pass labels
parameter (which is an array of labels used for that CPT).
You can customize these labels:
name
.singular_name
.As you can see, add_new_item
is the label that should solve your problem.
To change the label, add add_new_item in labels array passed when creating your custom post type. Below is an example of custom post type 'Events'.
add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'events',
array(
'labels' => array(
'name' => __( 'Events' ),
'singular_name' => __( 'Events' ),
'add_new_item' => __( 'Add Event' ),
'add_new' => __( 'Add Event' ),
'edit_item' => __( 'Edit Event' ),
'featured_image' => __( 'Event Image' ),
'set_featured_image' => __( 'Upload Event Image' ),
'remove_featured_image' => __( 'Remove Event Images' ),
'menu_name' => __( 'Manage Events' ),
),
'public' => true,
'menu_icon' => 'dashicons-calendar',
'has_archive' => true,
'supports' => array('title', 'thumbnail', 'editor'),
)
);
}
For more information about the changing labels in custom post type refer this link
Hope this helps.