| 1 |
<?php |
| 2 |
/** |
| 3 |
* Defines functions that are called by WordPress' Cron. |
| 4 |
* |
| 5 |
* @package WP_To_Buffer |
| 6 |
* @author WP Zinc |
| 7 |
*/ |
| 8 |
|
| 9 |
/** |
| 10 |
* Define the WP Cron function to perform the log cleanup |
| 11 |
* |
| 12 |
* @since 3.9.8 |
| 13 |
*/ |
| 14 |
function wp_to_buffer_log_cleanup_cron() { |
| 15 |
|
| 16 |
// Initialise Plugin. |
| 17 |
$wp_to_buffer = WP_To_Buffer::get_instance(); |
| 18 |
$wp_to_buffer->initialize(); |
| 19 |
|
| 20 |
// Call CRON Log Cleanup function. |
| 21 |
$wp_to_buffer->get_class( 'cron' )->log_cleanup(); |
| 22 |
|
| 23 |
// Shutdown. |
| 24 |
unset( $wp_to_buffer ); |
| 25 |
|
| 26 |
} |
| 27 |
add_action( 'wp_to_buffer_log_cleanup_cron', 'wp_to_buffer_log_cleanup_cron' ); |
| 28 |
|
| 29 |
/** |
| 30 |
* Define the WP Cron function to perform the Media Library cleanup |
| 31 |
* of Text to Image generations |
| 32 |
* |
| 33 |
* @since 4.1.0 |
| 34 |
*/ |
| 35 |
function wp_to_buffer_media_cleanup_cron() { |
| 36 |
|
| 37 |
// Initialise Plugin. |
| 38 |
$wp_to_buffer = WP_To_Buffer::get_instance(); |
| 39 |
$wp_to_buffer->initialize(); |
| 40 |
|
| 41 |
// Call Media Cleanup function. |
| 42 |
$wp_to_buffer->get_class( 'media_library' )->cleanup(); |
| 43 |
|
| 44 |
// Shutdown. |
| 45 |
unset( $wp_to_buffer ); |
| 46 |
|
| 47 |
} |
| 48 |
add_action( 'wp_to_buffer_media_cleanup_cron', 'wp_to_buffer_media_cleanup_cron' ); |
| 49 |
|