Skip to content

Commit

Permalink
Add fictioneer_expired_post_password action
Browse files Browse the repository at this point in the history
  • Loading branch information
Tetrakern committed Jan 5, 2025
1 parent ac71ecc commit 0b9df8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ACTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 2 additions & 0 deletions includes/functions/_service-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 0b9df8e

Please sign in to comment.