post_row_actions, This filter does not bring all the actions when I try to print_r
public function remove_quick_edit($actions) {
global $post;
echo "<pre>";
print_r($actions);
echo "</pre>";
$link_get = get_delete_post_link($post->ID);
if ( $post->post_type == 'cs_flags' ) {
unset($actions['inline hide-if-no-js']);
unset($actions['trash']);
$actions['delete'] = '<span class="trash"><a class="submitdelete deletion" href="' . get_delete_post_link($post->ID, '', true) . '">' . esc_html__('Delete', 'jobhunt') . '</a></span>';
}
return $actions;
}
The result it brings is only views it should bring edit and trash also but only view is there.
I was debugging why get_delete_post_link not working, so I found this issue maybe they are related to each other.
Custom post type code
$args = array(
'label' => __( 'Flags' ),
'description' => esc_html__( 'This is Description' ),
'public' => true,
'show_ui' => true,
'show_in_menu' => 'edit.php?post_type=jobs',
'menu_position' => true,
'supports' => array( 'title' ),
'exclude_from_search' => true,
'capabilities' => array(
'create_posts' => false,
'delete_posts' => true
)
);
register_post_type( 'cs_flags', $args );
}
'capabilities' => array( 'create_posts' => false, 'delete_posts' => true )
is not the correct way to use this argument. It's probably interfering with your capabilities. Refer to the documentation.