diff --git a/ACTIONS.md b/ACTIONS.md index de9ed268..fe594995 100644 --- a/ACTIONS.md +++ b/ACTIONS.md @@ -607,6 +607,14 @@ List page template hook. Fires right at the top of an empty result list in the ` --- +### `do_action( 'fictioneer_expired_post_password', $post )` +Fires after a post password has been expired, which happens when a visitor tries to access the post. + +**$args:** +* $post (WP_Post) – The post that had its password expired. + +--- + ### `do_action( 'fictioneer_footer', $args )` Fires outside the `#site` container and before the `wp_footer` hook, near the end of the document. Not to be confused with the `fictioneer_site_footer` hook. diff --git a/includes/functions/_service-posts.php b/includes/functions/_service-posts.php index f3f248a2..3522c462 100644 --- a/includes/functions/_service-posts.php +++ b/includes/functions/_service-posts.php @@ -383,6 +383,8 @@ function fictioneer_expire_post_password( $required, $post ) { fictioneer_refresh_post_caches( $post->ID ); wp_update_post( array( 'ID' => $post->ID, 'post_password' => '' ) ); + do_action( 'fictioneer_expired_post_password', $post ); + $required = false; } }