Skip to content

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.

Auto-generated Example

/**
 * 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 );

Parameters

  • WP_Post $post The post that was published.
  • array|\WP_Error $result applyWrites response on success, WP_Error on failure.

Files

\do_action( 'atmosphere_publish_post_result', $post, $result )
\do_action( 'atmosphere_publish_post_result', $post, $result )

← All Hooks

Clone this wiki locally