WP_Async_Task::launch()

Description #

Add the shutdown action for launching the real postback if we don’t get an exception thrown by prepare_data().

Source #

File: lib/class-wp-async-task.php

		public function launch() {
			$data = func_get_args();
			try {
				$data = $this->prepare_data( $data );
			} catch ( Exception $e ) {
				return;
			}

			$data['action'] = "wp_async_$this->action";
			$data['_nonce'] = $this->create_async_nonce();

			$this->_body_data = $data;

			if ( ! has_action( 'shutdown', array( $this, 'launch_on_shutdown' ) ) ) {
				add_action( 'shutdown', array( $this, 'launch_on_shutdown' ) );
			}
		}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment