PK œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
Dir : /home/trave494/footcrew.com/ads/wp-content/themes/classipress/includes/payments/utils/ |
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 IP: 209.182.202.254 |
Dir : /home/trave494/footcrew.com/ads/wp-content/themes/classipress/includes/payments/utils/queue.php |
<?php /** * Queue utils * * @package Components\Payments\Utils */ /** * Defines a process to retrieve a set of items and iterate over them on a set interval */ class APP_Queue{ /** * Name of process occuring */ protected $identifier; public function __construct( $identifier, $args = array() ){ $this->identifier = $identifier; $this->args = wp_parse_args( $args, array( 'interval' => 'daily', 'limit' => 0 ) ); add_action( 'init', array( $this, 'schedule_process' ) ); add_action( $this->identifier, array( $this, 'process' ) ); } /** * Schedules the process to happen every $interval * @return void */ public function schedule_process(){ if( !wp_next_scheduled( $this->identifier ) ){ wp_schedule_event( time(), $this->args['interval'], $this->identifier ); } } public function process(){ $items_processed = 0; $items = $this->get_items(); if( $items instanceof WP_Query ) $items = $items->posts; if( empty( $items ) ) return $items_processed; foreach( array_slice( $items, 0, $this->args['limit'] ) as $item ){ $this->process_item( $item ); $items_processed += 1; } return $items_processed; } }