Add filter to Patreon unlock gate message

This commit is contained in:
Tetrakern 2024-05-24 10:53:43 +02:00
parent 8c5073e868
commit 9ec44c8748
2 changed files with 12 additions and 0 deletions

View File

@ -712,6 +712,16 @@ Filters the pledge threshold amount of the Patreon gate for protected posts (if
---
### `apply_filters( 'fictioneer_filter_patreon_gate_message', $message, $options, $post )`
Filters the HTML of the message displayed below the Patreon unlock button. The message normally includes which tiers or pledge you need to unlock a post, but it can be overwritten in the settings and be completely custom.
**Parameters:**
* $message (string) HTML for the message.
* $options (array) HTML snippets of the unlock options, prepared for rendering.
* $post (WP_Post) Post object of the locked post.
---
### `apply_filters( 'fictioneer_filter_post_card_footer', $footer_items, $post, $args )`
Filters the intermediate output array in the `_card-post.php` partial before it is imploded and rendered. Contains statistics with icons such as the author, publishing date, and comments.

View File

@ -565,6 +565,8 @@ function fictioneer_unlock_with_patreon( $form ) {
}
}
$patreon_message = apply_filters( 'fictioneer_filter_patreon_gate_message', $patreon_message, $options, $post );
if ( ! empty( $patreon_user_data ) ) {
$auth_reminder = '<details class="unlock-with-patreon__already-member"><summary>' . _x( 'Already a member?', 'Unlock with Patreon help.', 'fictioneer' ) . '</summary><div>' . _x( 'If you are already a member but still do not see anything, log out and log in with Patreon again to refresh your membership information.', 'Unlock with Patreon help.', 'fictioneer' ) . '</div></details>';
}