rockschtar / wordpress-cronjob
Library for use with roots/bedrock based WordPress projects. Simplifys the creation of WordPress cronjobs.
Installs: 10 504
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.1
Requires (Dev)
- brain/monkey: 2.*
- phpunit/phpunit: ^7
This package is auto-updated.
Last update: 2024-12-17 21:11:35 UTC
README
Description
Library for use with roots/bedrock based WordPress projects. Simplifys the creation of WordPress cronjobs.
Requirements
- PHP 7.1+
- Composer to install
License
rockschtar/wordpress-cronjob is open source and released under MIT license. See LICENSE.md file for more info.
Usage
Create a cronjob class
class TestCronjob extends AbstractCronjob {
public function execute(): void {
//do some stuff
}
public function config(): CronjobConfig {
$config = new CronjobConfig();
$config->setHook('do_test_cronjob');
$config->setPluginFile('some_plugin.php');
$config->setFirstRun(new \DateTime());
$config->setRecurrence('daily');
return $config;
}
}
Initialize the class
TestCronjob::init();
Question? Issues?
rockschtar/wordpress-cronjob is hosted on GitLab. Feel free to open issues there for suggestions, questions and real issues.