-
Notifications
You must be signed in to change notification settings - Fork 1
atmosphere_publish_post_result
github-actions[bot] edited this page Jun 30, 2026
·
6 revisions
Fires after a post publish attempt completes, with the final result.
Subscribers can use this to react to success or failure — for
example, to instrument metrics, surface notifications, or schedule
follow-up jobs. Fires exactly once per publish_post() invocation
regardless of which internal path produced the result.
/**
* Fires after a post publish attempt completes, with the final result.
*
* Subscribers can use this to react to success or failure — for
* example, to instrument metrics, surface notifications, or schedule
* follow-up jobs. Fires exactly once per `publish_post()` invocation
* regardless of which internal path produced the result.
*
* @param WP_Post $post
* @param array|\WP_Error $result
*/
function my_atmosphere_publish_post_result_callback( WP_Post $post, array|\WP_Error $result ) {
// Your code here.
}
add_action( 'atmosphere_publish_post_result', 'my_atmosphere_publish_post_result_callback', 10, 2 );-
WP_Post$postThe post that was published. -
array|\WP_Error$resultapplyWritesresponse on success,WP_Erroron failure.
\do_action( 'atmosphere_publish_post_result', $post, $result )\do_action( 'atmosphere_publish_post_result', $post, $result )