Skip to content

Commit 2cbee1a

Browse files
committed
Merge branch 'boonebgorges-http-request-filters'
2 parents ffc4e9b + 51860bc commit 2cbee1a

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

classes/wp-async-request.php

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,17 @@ protected function get_query_args() {
9595
return $this->query_args;
9696
}
9797

98-
return array(
98+
$args = array(
9999
'action' => $this->identifier,
100100
'nonce' => wp_create_nonce( $this->identifier ),
101101
);
102+
103+
/**
104+
* Filters the post arguments used during an async request.
105+
*
106+
* @param array $url
107+
*/
108+
return apply_filters( $this->identifier . '_query_args', $args );
102109
}
103110

104111
/**
@@ -111,7 +118,14 @@ protected function get_query_url() {
111118
return $this->query_url;
112119
}
113120

114-
return admin_url( 'admin-ajax.php' );
121+
$url = admin_url( 'admin-ajax.php' );
122+
123+
/**
124+
* Filters the post arguments used during an async request.
125+
*
126+
* @param string $url
127+
*/
128+
return apply_filters( $this->identifier . '_query_url', $url );
115129
}
116130

117131
/**
@@ -124,13 +138,20 @@ protected function get_post_args() {
124138
return $this->post_args;
125139
}
126140

127-
return array(
141+
$args = array(
128142
'timeout' => 0.01,
129143
'blocking' => false,
130144
'body' => $this->data,
131145
'cookies' => $_COOKIE,
132146
'sslverify' => apply_filters( 'https_local_ssl_verify', false ),
133147
);
148+
149+
/**
150+
* Filters the post arguments used during an async request.
151+
*
152+
* @param array $args
153+
*/
154+
return apply_filters( $this->identifier . '_post_args', $args );
134155
}
135156

136157
/**

0 commit comments

Comments
 (0)