Update and document fictioneer_filter_patreon_dollars

This commit is contained in:
Tetrakern 2024-04-28 16:13:19 +02:00
parent 20361cbfff
commit e1d931eef7
2 changed files with 11 additions and 1 deletions

View File

@ -647,6 +647,16 @@ Filters the intermediate output array in the `_card-page.php` partial before it
---
### `apply_filters( 'fictioneer_filter_patreon_dollars', $dollar, $amount_cents_raw, $post )`
Filters the pledge threshold amount of the Patreon gate for protected posts (if any). Patreon stores tier prices in cents, so $2.50 would be 250 raw. The theme turns that back into the Dollar format, which you can intercept here. Note that Patreon has specific [rules for converting currencies](https://support.patreon.com/hc/en-us/articles/360044469871--How-tiers-are-converted-into-other-currencies).
**Parameters:**
* $dollar (string) The pledge threshold as "$0.00".
* $amount_cents_raw (int) The threshold in cents.
* $post (WP_Post) The gated 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

@ -539,7 +539,7 @@ function fictioneer_unlock_with_patreon( $form ) {
$options[] = sprintf(
_x( 'with any %s pledge', 'Unlock with Patreon pledge amount', 'fictioneer' ),
apply_filters( 'fictioneer_filter_patreon_dollars', $dollar, $patreon_post_data['gate_cents'] )
apply_filters( 'fictioneer_filter_patreon_dollars', $dollar, $patreon_post_data['gate_cents'], $post )
);
}