Skip to content

Commit

Permalink
Merge branch 'boonebgorges-http-request-filters'
Browse files Browse the repository at this point in the history
  • Loading branch information
polevaultweb committed Jul 31, 2020
2 parents ffc4e9b + 51860bc commit 2cbee1a
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions classes/wp-async-request.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,17 @@ protected function get_query_args() {
return $this->query_args;
}

return array(
$args = array(
'action' => $this->identifier,
'nonce' => wp_create_nonce( $this->identifier ),
);

/**
* Filters the post arguments used during an async request.
*
* @param array $url
*/
return apply_filters( $this->identifier . '_query_args', $args );
}

/**
Expand All @@ -111,7 +118,14 @@ protected function get_query_url() {
return $this->query_url;
}

return admin_url( 'admin-ajax.php' );
$url = admin_url( 'admin-ajax.php' );

/**
* Filters the post arguments used during an async request.
*
* @param string $url
*/
return apply_filters( $this->identifier . '_query_url', $url );
}

/**
Expand All @@ -124,13 +138,20 @@ protected function get_post_args() {
return $this->post_args;
}

return array(
$args = array(
'timeout' => 0.01,
'blocking' => false,
'body' => $this->data,
'cookies' => $_COOKIE,
'sslverify' => apply_filters( 'https_local_ssl_verify', false ),
);

/**
* Filters the post arguments used during an async request.
*
* @param array $args
*/
return apply_filters( $this->identifier . '_post_args', $args );
}

/**
Expand Down

0 comments on commit 2cbee1a

Please sign in to comment.