WP_Async_Task::prepare_data( array $data )

Description #

Prepare any data to be passed to the asynchronous postback

The array this function receives will be a numerically keyed array from func_get_args(). It is expected that you will return an associative array so that the $_POST values used in the asynchronous call will make sense.

The array you send back may or may not have anything to do with the data passed into this method. It all depends on the implementation details and what data is needed in the asynchronous postback.

Do not set values for ‘action’ or ‘_nonce’, as those will get overwritten later in launch().

Parameters #

  • $data
    array (Required) The raw data received by the launch method

Source #

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

		abstract protected function prepare_data( $data );

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