You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the solution , i am using this code to run clear cache feature when saving a post in wordpress. But my run_action () not executing .Can you please help:
This is my code in functions.php
include 'wp-async-task.php';
class ApiStatusTask extends WP_Async_Task {
protected $action = 'save_post';
/**
Prepare data for the asynchronous request
@throws Exception If for any reason the request should not happen
@param array $data An array of data sent to the hook
Thanks for the solution , i am using this code to run clear cache feature when saving a post in wordpress. But my run_action () not executing .Can you please help:
This is my code in functions.php
include 'wp-async-task.php';
class ApiStatusTask extends WP_Async_Task {
protected $action = 'save_post';
/**
*/
protected function prepare_data( $data ) {
return array(
'api_url' => $data[0]
);
}
/**
*/
protected function run_action() {
if(isset($POST['api_url'])){
do_action("wp_async$this->action", $_POST['api_url']);
}
// cache clear feature
}
}
add_action( 'wp_async_save_post', 'josh_send_to_api' );
function josh_send_to_api( $id ) {
wp_mail("[email protected]","subject","Content")
}
The text was updated successfully, but these errors were encountered: