https://github.com/underpin-wp/cron-job-loader
Cron Job Loader for Underpin
https://github.com/underpin-wp/cron-job-loader
cron-job underpin wordpress
Last synced: about 2 months ago
JSON representation
Cron Job Loader for Underpin
- Host: GitHub
- URL: https://github.com/underpin-wp/cron-job-loader
- Owner: Underpin-WP
- Created: 2021-05-02T23:22:38.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-11-24T21:32:23.000Z (over 4 years ago)
- Last Synced: 2025-03-02T01:14:58.123Z (over 1 year ago)
- Topics: cron-job, underpin, wordpress
- Language: PHP
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Underpin Cron Job Loader
Loader That assists with adding cron jobs menus to a WordPress website.
## Installation
### Using Composer
`composer require underpin/loaders/cron-jobs`
### Manually
This plugin uses a built-in autoloader, so as long as it is required _before_
Underpin, it should work as-expected.
`require_once(__DIR__ . '/underpin-cron-jobs/cron-jobs.php');`
## Setup
1. Install Underpin. See [Underpin Docs](https://www.github.com/underpin-wp/underpin)
1. Register new cron jobs menus as-needed.
## Example
A very basic example could look something like this.
```php
underpin()->cron_jobs()->add( 'test', [
'action_callback' => '__return_true',
'name' => 'Event Name',
'frequency' => 'daily',
'description' => 'The description',
] );
```
Alternatively, you can extend `Cron_Job` and reference the extended class directly, like so:
```php
underpin()->cron_jobs()->add('cron-job-key','Namespace\To\Class');
```