Add fictioneer_expired_post_password action

This commit is contained in:
Tetrakern 2025-01-05 08:05:04 +01:00
parent ac71ecce7a
commit 0b9df8e84a
2 changed files with 10 additions and 0 deletions

View File

@ -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 )` ### `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. 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.

View File

@ -383,6 +383,8 @@ function fictioneer_expire_post_password( $required, $post ) {
fictioneer_refresh_post_caches( $post->ID ); fictioneer_refresh_post_caches( $post->ID );
wp_update_post( array( 'ID' => $post->ID, 'post_password' => '' ) ); wp_update_post( array( 'ID' => $post->ID, 'post_password' => '' ) );
do_action( 'fictioneer_expired_post_password', $post );
$required = false; $required = false;
} }
} }