WP Manifestindependent plugin directory
manifest / developer / wp-async-task

WP Asynchronous Tasks

Creates an abstract class to execute asynchronous tasks

by 10up, Eric Mann, Luke Gedeon, John P. Bloch · github.com/techcrunch/wp-async-task

728stars
25kcomposer installs
74forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/techcrunch/wp-async-task/archive/refs/heads/master.zip

Also on Packagist as techcrunch/wp-async-task:

composer require techcrunch/wp-async-task

From the readme

TechCrunch WP Asynchronous Tasks TechCrunch WP Asynchronous Tasks plugin for TechCrunch.com Quick Start WP Async Task can be installed as a plugin or bundled in other plugins or a theme. The class definition is wrapped in a classexists check, so it will never run the risk of being accidentally defined twice. Just make sure that the plugin file is being included somehow. Next, you need to extend the class with your own implementation. Implementations of the class act on an arbitrary action (e.g., 'savepost', etc). There are three parts that must be present in any class extending WPAsyncTask: 1. A protected $action property 2. A protected preparedata() method 3. A protected runaction() method $action The protected $action property should be set to the action to which you wish to attach the asynchronous task. For example, if you want to spin off an asynchronous task whenever a post gets saved, you would set this to savepost. preparedata( $data ) Use this method to prepare the action's data for use in the asynchronous process. Data will be given to preparedata() as an indexed array, just as it would if you used funcgetargs() to get a function's arguments. This method needs to

Read the full README on GitHub →