I'm trying to remove user ability to trash on user dashboard for a post type 'event' using out post_row_actions but script does not work.
The url is wp-admin/edit.php?post_type=event
add_filter( 'post_row_actions', 'remove_row_actions', 10, 1 );
function remove_row_actions( $actions )
{
if( get_post_type() === 'event' )
unset( $actions['edit'] );
unset( $actions['view'] );
unset( $actions['trash'] );
unset( $actions['inline hide-if-no-js'] );
return $actions;
I've also tried swaping post_row_action with page_row_action with no success
I know the script is correctly detecting the post type by testing with a simple echo in the if statement. It just does not remove any of the links on the dashboard
ifbrackets and also the closing bracket for the function... - brasofilo