GF_Background_Upgrader::class, self::FEEDS => GF_Feed_Processor::class, self::NOTIFICATIONS => GF_Notifications_Processor::class, self::TELEMETRY => GF_Telemetry_Processor::class, self::BULK_ACTION => GF_Entry_Bulk_Action_Processor::class, ); /** * Initializing the processors and adding them to the container as services. * * @since 2.6.9 * * @param GF_Service_Container $container */ public function register( GF_Service_Container $container ) { GFForms::init_background_upgrader(); require_once GF_PLUGIN_DIR_PATH . 'includes/addon/class-gf-feed-processor.php'; require_once GF_PLUGIN_DIR_PATH . 'includes/async/class-gf-notifications-processor.php'; require_once GF_PLUGIN_DIR_PATH . 'includes/telemetry/class-gf-telemetry-processor.php'; require_once GF_PLUGIN_DIR_PATH . 'includes/bulk-actions/class-gf-entry-bulk-action-processor.php'; require_once GF_PLUGIN_DIR_PATH . 'includes/bulk-actions/endpoints/class-gf-bulk-action-endpoint-start.php'; require_once GF_PLUGIN_DIR_PATH . 'includes/bulk-actions/endpoints/class-gf-bulk-action-endpoint-status.php'; require_once GF_PLUGIN_DIR_PATH . 'includes/bulk-actions/endpoints/class-gf-bulk-action-endpoint-cancel.php'; foreach ( $this->processors as $name => $class ) { $container->add( $name, function () use ( $name, $class ) { if ( $name === self::UPGRADER ) { return GFForms::$background_upgrader; } $callback = array( $class, 'get_instance' ); if ( is_callable( $callback ) ) { return call_user_func( $callback ); } return new $class(); } ); } $container->add( self::BULK_ACTION_ENDPOINT_START, function() { return new GF_Bulk_Action_Endpoint_Start(); } ); $container->add( self::BULK_ACTION_ENDPOINT_STATUS, function() { return new GF_Bulk_Action_Endpoint_Status(); } ); $container->add( self::BULK_ACTION_ENDPOINT_CANCEL, function() { return new GF_Bulk_Action_Endpoint_Cancel(); } ); } public function init( GF_Service_Container $container ) { add_action( 'wp_ajax_' . GF_Bulk_Action_Endpoint_Start::ACTION_NAME, function() use ( $container ) { $container->get( self::BULK_ACTION_ENDPOINT_START )->handle(); } ); add_action( 'wp_ajax_' . GF_Bulk_Action_Endpoint_Status::ACTION_NAME, function() use ( $container ) { $container->get( self::BULK_ACTION_ENDPOINT_STATUS )->handle(); } ); add_action( 'wp_ajax_' . GF_Bulk_Action_Endpoint_Cancel::ACTION_NAME, function() use ( $container ) { $container->get( self::BULK_ACTION_ENDPOINT_CANCEL )->handle(); } ); } }