Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create custom actions #84

Open
jjgrainger opened this issue Jun 15, 2022 · 0 comments
Open

Create custom actions #84

jjgrainger opened this issue Jun 15, 2022 · 0 comments

Comments

@jjgrainger
Copy link
Owner

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.
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant