2020-04-07 13:03:04 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2020-08-13 14:53:39 +00:00
|
|
|
* This file handles background processes.
|
|
|
|
*
|
|
|
|
* @package GP Premium
|
2020-04-07 13:03:04 +00:00
|
|
|
*/
|
|
|
|
|
2020-08-13 14:53:39 +00:00
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
|
|
exit; // No direct access, please.
|
|
|
|
}
|
|
|
|
|
2020-04-07 13:03:04 +00:00
|
|
|
if ( class_exists( 'WP_Background_Process' ) ) {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Image Background Process
|
|
|
|
*
|
|
|
|
* @since 1.0.11
|
|
|
|
*/
|
|
|
|
class GeneratePress_Site_Background_Process extends WP_Background_Process {
|
|
|
|
|
2020-08-13 14:53:39 +00:00
|
|
|
/**
|
|
|
|
* What we're doing.
|
|
|
|
*
|
|
|
|
* @var $action
|
|
|
|
*/
|
2020-04-07 13:03:04 +00:00
|
|
|
protected $action = 'image_process';
|
|
|
|
|
2020-08-13 14:53:39 +00:00
|
|
|
/**
|
|
|
|
* Do the task.
|
|
|
|
*
|
|
|
|
* @param class $process The process.
|
|
|
|
*/
|
2020-04-07 13:03:04 +00:00
|
|
|
protected function task( $process ) {
|
|
|
|
|
|
|
|
if ( method_exists( $process, 'import' ) ) {
|
|
|
|
$process->import();
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-08-13 14:53:39 +00:00
|
|
|
/**
|
|
|
|
* Complete the task.
|
|
|
|
*/
|
2020-04-07 13:03:04 +00:00
|
|
|
protected function complete() {
|
|
|
|
|
|
|
|
parent::complete();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|