BC Migration Documentation

WP_Async_Request
in package

AbstractYes

Abstract WP_Async_Request class.

Tags
abstract

Table of Contents

Properties

$action  : string
Action
$data  : array<string|int, mixed>
Data
$identifier  : mixed
Identifier
$prefix  : string
Prefix

Methods

__construct()  : mixed
Initiate new async request.
data()  : $this
Set data used during the request.
dispatch()  : array<string|int, mixed>|WP_Error|false
Dispatch the async request.
maybe_handle()  : void|mixed
Maybe handle a dispatched request.
get_post_args()  : array<string|int, mixed>
Get post args.
get_query_args()  : array<string|int, mixed>
Get query args.
get_query_url()  : string
Get query URL.
handle()  : mixed
Handle a dispatched request.
maybe_wp_die()  : void|mixed
Should the process exit with wp_die?

Properties

$action

Action

protected string $action = 'async_request'

(default value: 'async_request')

Tags
access

protected

$data

Data

protected array<string|int, mixed> $data = array()

(default value: array())

Tags
access

protected

$identifier

Identifier

protected mixed $identifier
Tags
access

protected

$prefix

Prefix

protected string $prefix = 'wp'

(default value: 'wp')

Tags
access

protected

Methods

data()

Set data used during the request.

public data(array<string|int, mixed> $data) : $this
Parameters
$data : array<string|int, mixed>

Data.

Return values
$this

dispatch()

Dispatch the async request.

public dispatch() : array<string|int, mixed>|WP_Error|false
Return values
array<string|int, mixed>|WP_Error|false

HTTP Response array, WP_Error on failure, or false if not attempted.

maybe_handle()

Maybe handle a dispatched request.

public maybe_handle() : void|mixed

Check for correct nonce and pass to handler.

Return values
void|mixed

get_post_args()

Get post args.

protected get_post_args() : array<string|int, mixed>
Return values
array<string|int, mixed>

get_query_args()

Get query args.

protected get_query_args() : array<string|int, mixed>
Return values
array<string|int, mixed>

get_query_url()

Get query URL.

protected get_query_url() : string
Return values
string

handle()

Handle a dispatched request.

protected abstract handle() : mixed

Override this method to perform any actions required during the async request.

maybe_wp_die()

Should the process exit with wp_die?

protected maybe_wp_die([mixed $return = null ]) : void|mixed
Parameters
$return : mixed = null

What to return if filter says don't die, default is null.

Return values
void|mixed

        
On this page

Search results