rockschtar/wordpress-cronjob

Library for use with roots/bedrock based WordPress projects. Simplifys the creation of WordPress cronjobs.

Installs: 12 183

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/rockschtar/wordpress-cronjob

1.0.0 2020-05-26 08:04 UTC

This package is auto-updated.

Last update: 2025-09-17 22:47:29 UTC


README

Description

Library for use with roots/bedrock based WordPress projects. Simplifys the creation of WordPress cronjobs.

Requirements

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.