I have been following the following guide: step by step guide to wp list table however i can’t figure out where should i define my action: duplicate in the code. I want to add a link to simply duplicate the according row, any idea ?

$actions = array(
    'edit' => sprintf('<a href="https://wordpress.stackexchange.com/questions/227662/?page=cruises_form&id=%s">%s</a>', $item['id'], __('Edit', 'cruise_list_manager')),
    'delete' => sprintf('<a href="?page=%s&action=delete&id=%s">%s</a>', $_REQUEST['page'], $item['id'], __('Delete', 'cruise_list_manager')),
    'duplicate' => sprintf('<a href="?page=%s&action=duplicate&id=%s">%s</a>', $_REQUEST['page'], $item['id'], __('Duplicate', 'cruise_list_manager')),
);

return sprintf('%s %s',
    $item['name'],
    $this->row_actions($actions)
    );
}

Thank you very much.

1 Answer
1

Found it, the action needs to be defined in your plugin function:

function process_bulk_action()
    {

Leave a Reply

Your email address will not be published. Required fields are marked *