Link Actions (array)

array key: link_actions

array values: array(column key => array(action links…))
The link_actions definition defines the links that generally appear when hovering over the primary data column. The actions usually consist of links which either open up editing pages or similar, or cause a delete through the process_link_actions callable. Although actions are defined as an array, since they usually include per rows values and are different in Standard or Trash views a defined callable is usually best. In general an action must link to an appropriate query string with values that will be used in processing via process_link_actions.

$list_table_definitions['link_actions'] = call_user_func('saturn_tables_cars_list_table_actions', $page, $item, $page_number);
function saturn_tables_cars_list_table_actions ( $page, $item, $page_number) {

    $item_id = (isset($item['id']) && ((int)$item['id'] > 0)) ? $item['id'] : 0;

    if (isset($_GET['status']) && ($_GET['status'] == "trash")) {
            $links = array( 'make' => array('delete' => sprintf( '<a href="?page=%s&delete_id=%d&paged=%d">Delete Permanently</a>', $page, $item_id, $page_number ),
                                            'restore' => sprintf( '<a href="?page=%s&restore_id=%d&paged=%d">Restore</a>', $page, $item_id, $page_number )));

    } else {
            $links = array( 'make' => array('trash' => sprintf( '<a href="?page=%s&trash_id=%d&paged=%d">Trash</a>', $page, $item_id , $page_number ),
                                            'edit' => sprintf( '<a href="?page=%s&id=%d">Edit</a>', 'saturn-tables-cars-add-edit-car', $item_id ) ) );

    }
    return $links;
}