Skip to content

Create custom actions #84

Open
Open
@jjgrainger

Description

@jjgrainger

Provide the ability to create custom bulk and row actions with PostTypes. An example of the API could be as follows, but needs further exploration.

// Create a basic event post type.
$event = new PostType('event');

// Create a 'Cancel Event' Bulk Actions
$event->actions()->bulk(
    'cancel-event',     // The unique action name.
    __('Cancel Event'), // The action label.
    function($redirect_url, $action, $post_ids) { // Callback to handle the bulk action request.
        // Do stuff
        return $redirect_url;
    },
    'upload_files' // Optional: Set the capability required to use the bulk action.
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions