2

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="?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.

2

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

function process_bulk_action()
    {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.