I'm using this code to have a duplicate post function in WordPress Admin. However, when I add the filter for a custom post type, like this:
add_filter( 'directory_row_actions', 'rd_duplicate_post_link', 10, 2 );
(The Custom Post Type has a registered name of directory
) - it doesn't add it to the action row underneath the entry title. When I do it for the posts or pages, like this:
add_filter( 'post_row_actions', 'rd_duplicate_post_link', 10, 2 );
it works perfectly. I've been reading that post_row_actions
has been deprecated but I can't find anywhere that says it's replacement. Does anyone know how to get this working for my Custom Post Type?
page_row_actions
for hierarchical post types, andpost_row_actions
for all others (there's no post_type-specific filter), so one of them should work for you. (You'll have to check the passed in$post->post_type
for varying behaviour.) Nothing in the code anyway about deprecation.