Add fictioneer_expired_post_password action
This commit is contained in:
parent
ac71ecce7a
commit
0b9df8e84a
@ -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.
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user