Every filter and action the plugin exposes — 83 in all. This page is built from the plugin source, so it always matches the version you are running.
Access & Entitlements
fabrica_monetization_kit_entitlement_added
Fires once a one-off purchase has been recorded and the reader can see what they bought. The usual place to hang a receipt email, a CRM sync or an analytics event.
$entityType is post, term or author. It does not fire for
subscriptions — see fabrica_monetization_kit_entity_subscription_created.
add_action('fabrica_monetization_kit_entitlement_added', function($userId, $transactionId, $entityType, $objectSubtype, $entityId, $orderId, $metadata) {
// …
}, 10, 7);Source: UserEntitlements.php:128
fabrica_monetization_kit_entitlement_removed
Fires when a purchase is taken away again, typically after a refund. The reader has already lost access by this point.
add_action('fabrica_monetization_kit_entitlement_removed', function($userId, $transactionId) {
// …
}, 10, 2);Source: UserEntitlements.php:157
fabrica_monetization_kit_entity_subscription_created
Fires when a reader subscribes to one author or one taxonomy term, rather than to the whole site.
add_action('fabrica_monetization_kit_entity_subscription_created', function($userId, $entityType, $entityId, $metadata) {
// …
}, 10, 4);Source: UserEntitlements.php:181
fabrica_monetization_kit_post_duration
How long access lasts after someone buys a single post, in days. Zero means forever, which is the default.
add_filter('fabrica_monetization_kit_post_duration', function($durationDays, $postId, $postType) {
return $durationDays;
}, 10, 3);Source: UserEntitlements.php:87
fabrica_monetization_kit_term_date
A term’s publication date, used to decide whether a date-based subscription covers it.
Read from the edition_date term meta by default. Point this at
your own meta key if your issues or seasons store their date
somewhere else.
add_filter('fabrica_monetization_kit_term_date', function($date, $termId) {
return $date;
}, 10, 2);Source: UserEntitlements.php:819
fabrica_monetization_kit_user_has_access
Last word on whether a reader may see a gated post, after every purchase and subscription check has already said no.
Use it to grant access from somewhere the plugin knows nothing about — a staff role, a partner institution, a legacy members table. Returning false changes nothing, so it can only ever open access, never close it.
The answer is cached for the rest of the request.
add_filter('fabrica_monetization_kit_user_has_access', function($value, $userId, $postId) {
return $value;
}, 10, 3);Source: Entitlements.php:189
fabrica_monetization_kit_user_purchased_authors
The authors a reader has bought outright, unlocking that author’s whole back catalogue.
add_filter('fabrica_monetization_kit_user_purchased_authors', function($authors, $userId) {
return $authors;
}, 10, 2);Source: UserEntitlements.php:602
fabrica_monetization_kit_user_purchased_posts
The posts a reader has bought outright, newest first, as listed in My Account.
add_filter('fabrica_monetization_kit_user_purchased_posts', function($posts, $userId) {
return $posts;
}, 10, 2);Source: UserEntitlements.php:480
fabrica_monetization_kit_user_purchased_terms
The term bundles a reader has bought — issues, seasons, series —
newest first. $taxonomy is set when the list was narrowed to one
taxonomy, otherwise null.
add_filter('fabrica_monetization_kit_user_purchased_terms', function($terms, $userId, $taxonomy) {
return $terms;
}, 10, 3);Source: UserEntitlements.php:536
fabrica_monetization_kit_user_retained_subscriptions
Cancelled or lapsed subscriptions a reader still gets something from, newest end date first.
Someone who paid for a stretch of time keeps the content published during it, so a former subscriber does not lose the issues they paid for. Applies only where the access model is date-based.
add_filter('fabrica_monetization_kit_user_retained_subscriptions', function($retained, $userId) {
return $retained;
}, 10, 2);Source: UserEntitlements.php:902
fabrica_monetization_kit_user_state
What the wall believes about this reader, just before it renders.
This is the single answer every wall is built from: whether they are logged in, whether they hold a subscription, whether that subscription covers this post, and whether one is stalled on payment. Filter it to drive the wall from a membership system the plugin knows nothing about, without rebuilding the markup.
Keys: is_logged_in, has_subscription, subscription_covers,
subscription_message, has_held_subscription,
held_subscription_message, held_subscription_url, user_info.
This changes what the reader is shown, not what they may read —
access is decided by fabrica_monetization_kit_user_has_access. Claim
a subscription here and the wall steps aside while the content stays
gated, so set both or neither.
Cached per user and post for the rest of the request.
add_filter('fabrica_monetization_kit_user_state', function($state, $userId, $postId) {
return $state;
}, 10, 3);Source: Entitlements.php:340
fabrica_monetization_kit_user_subscribed_authors
The authors a reader subscribes to, as listed in My Account. These
are recurring, unlike the one-off buys in
fabrica_monetization_kit_user_purchased_authors.
add_filter('fabrica_monetization_kit_user_subscribed_authors', function($authors, $userId) {
return $authors;
}, 10, 2);Source: UserEntitlements.php:646
fabrica_monetization_kit_user_subscription_terms
The terms a reader’s site-wide subscription currently covers. On a date-based site that means the issues published inside their subscription window.
add_filter('fabrica_monetization_kit_user_subscription_terms', function($terms, $userId, $taxonomy) {
return $terms;
}, 10, 3);Source: UserEntitlements.php:806
Accounts
fabrica_monetization_kit_login_code_email
The login-code email, so you can send it on-brand or as HTML instead of the built-in plain-text one.
Keys: to, subject, message, headers. For HTML, add a
Content-Type: text/html header and supply matching markup.
The code itself is in message and nowhere else, so a replacement
that drops it locks readers out.
add_filter('fabrica_monetization_kit_login_code_email', function($value, $code, $expiryMinutes) {
return $value;
}, 10, 3);Source: Services/LoginCode.php:225
fabrica_monetization_kit_login_code_expiry
How long an emailed login code stays valid, in seconds. Ten minutes by default, never less than one.
add_filter('fabrica_monetization_kit_login_code_expiry', function($value) {
return $value;
});Source: Services/LoginCode.php:65
fabrica_monetization_kit_login_code_length
How many digits are in an emailed login code. Six by default, never fewer than four.
add_filter('fabrica_monetization_kit_login_code_length', function($value) {
return $value;
});Source: Services/LoginCode.php:54
fabrica_monetization_kit_login_code_max_attempts
How many wrong guesses a login code survives before it is thrown away and the reader must request another. Five by default.
add_filter('fabrica_monetization_kit_login_code_max_attempts', function($value) {
return $value;
});Source: Services/LoginCode.php:76
fabrica_monetization_kit_regwall_registered
Fires when a reader creates an account at a registration wall. They are already logged in by this point.
The obvious place to add them to a newsletter or CRM. $context
says where they signed up from.
add_action('fabrica_monetization_kit_regwall_registered', function($userId, $email, $context) {
// …
}, 10, 3);Source: Utils/UserAccount.php:162
Blocks
fabrica_monetization_kit_account_content
Replace the whole account block for a logged-in reader with your own layout. Return HTML, or null to keep the built-in one.
“Held” below means a subscription whose payment has stalled — Stripe
past_due, unpaid, incomplete or paused, or WooCommerce
on-hold or pending. Held subscriptions are shown so a reader can
fix them, but they do not grant access.
$accountData carries:
user— the WP_User.has_subscription— a site subscription, active or held.has_membership— a membership product, active or held.has_recurring— any recurring payment at all, active or held.recurring_subscriptions— recurring payments as the default donor view lists them, active and held together.classified_subscriptions— active subscriptions split intosubscriptions,memberships,campaign_contributionsandother_recurring. These are the ones granting access.classified_held_subscriptions— held subscriptions, same four groups.held_subscriptions— every held subscription, ungrouped.purchased_posts— posts bought outright.content_access— everything the reader can see.portal_url— Stripe billing portal link, or null.logout_url— log-out link, nonce included.attributes— the block or shortcode attributes.
add_filter('fabrica_monetization_kit_account_content', function($value, $accountData) {
return $value;
}, 10, 2);Source: AccountBlock.php:635
fabrica_monetization_kit_account_page
Which page carries the account UI. Overrides the Accounts & login → Account page setting.
Useful where one setting cannot answer for the whole site: a multilingual install serving a different page per language, or a multisite sharing one plugin config. Return a page ID; return 0 to behave as though none is set.
Whatever you return still has to be a published page, or the plugin treats it as unset — the set-password link in a welcome email has to resolve for a logged-out stranger.
add_filter('fabrica_monetization_kit_account_page', function($value) {
return $value;
});Source: AccountBlock.php:451
fabrica_monetization_kit_contribution_recorded
Fires when a donation to a campaign has been recorded. The place to push a donor to your newsletter, CRM or Slack.
Fires for one-off donations, the first payment of a recurring one,
and every renewal after that — so check $metadata['subscription_id']
and $metadata['mode'] before treating one as a new donor.
$userId is 0 when the donation could not be matched to an account,
which happens if the donor closed the page before returning to the
site.
add_action('fabrica_monetization_kit_contribution_recorded', function($userId, $campaignId, $amount, $email, $metadata) {
// …
}, 10, 5);Source: ContributionsBlock.php:807
fabrica_monetization_kit_membership_footer
HTML below the membership block only, applied after the shared
fabrica_monetization_kit_footer.
add_filter('fabrica_monetization_kit_membership_footer', function($footer) {
return $footer;
});Source: MembershipBlock.php:161
fabrica_monetization_kit_membership_header
HTML above the membership block only, applied after the shared
fabrica_monetization_kit_header.
add_filter('fabrica_monetization_kit_membership_header', function($header) {
return $header;
});Source: MembershipBlock.php:134
Content Detection
fabrica_monetization_kit_access_granting_authors
The post’s authors who are actually on sale, each with a price, as
offered on the paywall. Filtered down from
fabrica_monetization_kit_post_authors_for_access to those marked
purchasable.
add_filter('fabrica_monetization_kit_access_granting_authors', function($authors, $postId) {
return $authors;
}, 10, 2);Source: Utils/ContentDetector.php:531
fabrica_monetization_kit_access_level
How hard a post is gated: open, registration, metered or
paid. This decides which wall a reader sees, if any.
It fires wherever the level was resolved from — the post’s own setting, its terms, or the site default — so a callback here has the last word in every case.
add_filter('fabrica_monetization_kit_access_level', function($postLevel, $postId) {
return $postLevel;
}, 10, 2);Source: Utils/ContentDetector.php:180, Utils/ContentDetector.php:186, Utils/ContentDetector.php:194
fabrica_monetization_kit_always_show_blocks
Block types that always render in the preview without using up any of the reader’s free blocks. Defaults to cover blocks, so a post’s hero image survives the wall.
add_filter('fabrica_monetization_kit_always_show_blocks', function($value) {
return $value;
});Source: Utils/ContentDetector.php:418
fabrica_monetization_kit_content_price
The price of a single post or term, in the smallest currency unit (pence for GBP). You get the figure the settings produced; return your own to override it.
This is the listed price. To change what someone is actually
charged at checkout, use fabrica_monetization_kit_price.
add_filter('fabrica_monetization_kit_content_price', function($price, $contentId, $contentType, $subtype) {
return $price;
}, 10, 4);Source: Utils/ContentDetector.php:366
fabrica_monetization_kit_counted_blocks
Which block types count towards the preview length. Defaults to paragraphs only, so headings and images don’t eat a reader’s free blocks.
add_filter('fabrica_monetization_kit_counted_blocks', function($value) {
return $value;
});Source: Utils/ContentDetector.php:404
fabrica_monetization_kit_post_authors_for_access
Who counts as an author of this post when working out access. Use it to credit contributors your theme tracks separately.
Co-Authors Plus guest authors are already included. Each entry is
['id' => int, 'type' => 'user'|'guest-author', 'name' => string].
add_filter('fabrica_monetization_kit_post_authors_for_access', function($authors, $postId) {
return $authors;
}, 10, 2);Source: Utils/ContentDetector.php:499
fabrica_monetization_kit_preview_length
How much of a gated post a reader sees before the wall, counted in blocks. Defaults to 4.
Only the block types in fabrica_monetization_kit_counted_blocks
count towards it. A per-post override set in the editor wins over
this filter.
add_filter('fabrica_monetization_kit_preview_length', function($value, $postId) {
return $value;
}, 10, 2);Source: Utils/ContentDetector.php:390
fabrica_monetization_kit_purchasable_taxonomies
Which taxonomies can be sold as bundles. A reader who buys one of these terms gets every post carrying it — an issue, a season, a series.
add_filter('fabrica_monetization_kit_purchasable_taxonomies', function($purchasableTaxonomies) {
return $purchasableTaxonomies;
});Source: Utils/ContentDetector.php:299, Utils/SubscriptionContentAccess.php:57
fabrica_monetization_kit_restricted_post_types
Which post types can be gated at all. A post of any other type is never walled, whatever else is set on it.
The list you receive depends on the restriction mode: in
all_restricted it is the saved Restricted post types setting, in
every other mode it is all public post types.
add_filter('fabrica_monetization_kit_restricted_post_types', function($restrictedPostTypes, $restrictionMode) {
return $restrictedPostTypes;
}, 10, 2);Source: Utils/ContentDetector.php:53
fabrica_monetization_kit_should_restrict_content
Whether this post should be gated. Use it to gate by something the restriction modes can’t express — a particular category, say, or a private taxonomy term.
The post must still be of a restricted post type, and an open
access level always wins, so returning true cannot wall a post that
has no wall to show. To force-gate such a post, raise its level with
fabrica_monetization_kit_access_level too.
add_filter('fabrica_monetization_kit_should_restrict_content', function($restrict, $postId) {
return $restrict;
}, 10, 2);Source: Utils/ContentDetector.php:83
fabrica_monetization_kit_user_can_bypass
Whether the logged-in user sees gated content without paying. True by default for anyone who can edit posts, so editors and admins read the site normally.
add_filter('fabrica_monetization_kit_user_can_bypass', function($canBypass) {
return $canBypass;
});Source: Utils/ContentDetector.php:439
Licensing
fabrica_monetization_kit_update_url
Where this site checks for plugin updates and activates its licence.
Point it at a staging or stub update server to exercise activation
without touching the live licence records. Activation is refused for
local addresses by both this plugin and the update server, so a local
test also needs fabrica/autoupdate/is_local_domain returning false.
add_filter('fabrica_monetization_kit_update_url', function($value) {
return $value;
});Source: License.php:74
My Account
fabrica_monetization_kit_myaccount_template
Absolute path to your own template for the My Account digital content tab, replacing the built-in one. Empty by default.
Ignored if the file does not exist.
add_filter('fabrica_monetization_kit_myaccount_template', function($value) {
return $value;
});Source: MyAccount.php:234
fabrica_monetization_kit_register_myaccount_page
Whether to add the plugin’s “Digital content” tab to the WooCommerce My Account page. Return false if your theme lists purchases itself.
WooCommerce sites only.
add_filter('fabrica_monetization_kit_register_myaccount_page', function($value) {
return $value;
});Source: MyAccount.php:35
fabrica_monetization_kit_render_authors_list
Replace how bought authors are listed in My Account. Return your own HTML, or null to keep the built-in list.
add_filter('fabrica_monetization_kit_render_authors_list', function($value, $authors) {
return $value;
}, 10, 2);Source: MyAccount.php:628
fabrica_monetization_kit_render_posts_list
Replace how bought posts are listed in My Account. Return your own HTML, or null to keep the built-in list.
add_filter('fabrica_monetization_kit_render_posts_list', function($value, $posts) {
return $value;
}, 10, 2);Source: MyAccount.php:584
fabrica_monetization_kit_render_subscribed_authors_list
Replace how subscribed-to authors are listed in My Account. Return your own HTML, or null to keep the built-in list.
add_filter('fabrica_monetization_kit_render_subscribed_authors_list', function($value, $authors) {
return $value;
}, 10, 2);Source: MyAccount.php:714
fabrica_monetization_kit_render_terms_list
Replace how the term bundles are listed in My Account. Return your own HTML, or null to keep the built-in list.
$type is subscription or purchased.
add_filter('fabrica_monetization_kit_render_terms_list', function($value, $terms, $type) {
return $value;
}, 10, 3);Source: MyAccount.php:535
fabrica_monetization_kit_shop_url
Where the “Browse” link on the empty My Account tab points. Defaults to the WooCommerce shop page.
add_filter('fabrica_monetization_kit_shop_url', function($value) {
return $value;
});Source: MyAccount.php:508
fabrica_monetization_kit_subscribe_url
Where to send a reader who has bought nothing yet, from the “Subscribe” link on the empty My Account tab. Empty by default, which hides the link.
add_filter('fabrica_monetization_kit_subscribe_url', function($value) {
return $value;
});Source: MyAccount.php:503
Paywall
fabrica_monetization_kit_bypass_restriction
Whether to let this request past the wall entirely.
You receive whatever the Bypass user agents setting decided. That
list is empty by default, so $bypass is false unless the site has
added patterns — typically to let search-engine crawlers index gated
content. Use this filter for exemptions a user-agent string cannot
express, such as a partner referrer or a preview link.
Returning true serves the full post to anyone the condition
matches, so keep it narrow. To gate more rather than less, use
fabrica_monetization_kit_should_restrict_content.
add_filter('fabrica_monetization_kit_bypass_restriction', function($bypass, $postId, $accessLevel) {
return $bypass;
}, 10, 3);Source: Paywall.php:155, Paywall.php:302, Paywall.php:362
fabrica_monetization_kit_default_message
The plain-text fallback shown when no paywall template renders — in feeds, for example, or if a template is missing.
add_filter('fabrica_monetization_kit_default_message', function($message) {
return $message;
});Source: Paywall.php:652
fabrica_monetization_kit_footer
HTML to place below the paywall, registration wall or membership block — a link to your subscription terms, say. Empty by default.
$context tells you which wall you are on: paywall, regwall or
membership.
add_filter('fabrica_monetization_kit_footer', function($value, $context) {
return $value;
}, 10, 2);Source: Paywall.php:422
fabrica_monetization_kit_header
HTML to place above the paywall, registration wall or membership block — a subscriber notice, say. Empty by default.
$context tells you which wall you are on: paywall, regwall or
membership.
add_filter('fabrica_monetization_kit_header', function($value, $context) {
return $value;
}, 10, 2);Source: Paywall.php:414
fabrica_monetization_kit_message
The finished paywall HTML, just before it replaces the post body. Use it to wrap, append to, or completely replace the wall.
For copy changes alone, fabrica_monetization_kit_text is easier —
it targets individual strings without you rebuilding the markup.
add_filter('fabrica_monetization_kit_message', function($html, $postId) {
return $html;
}, 10, 2);Source: Paywall.php:455, Paywall.php:495
fabrica_monetization_kit_preview_content
The free preview HTML — the part of a gated post shown above the wall — after truncation and block rendering.
Use it to append a teaser, fade the last paragraph, or trim further.
To change how much is shown, fabrica_monetization_kit_preview_length
is simpler.
Whatever you return is shown to logged-out visitors and search engines, so do not put paid content back in.
add_filter('fabrica_monetization_kit_preview_content', function($result, $postId) {
return $result;
}, 10, 2);Source: Paywall/PreviewRenderer.php:60
fabrica_monetization_kit_purchase_options
What a reader is offered on the wall: which term bundles, authors and subscriptions appear, in what order.
Everything the wall can sell passes through here, so this is the
place to add an offer, drop one, or reorder them. Prices are set
elsewhere — see fabrica_monetization_kit_price.
$group says which list you have: terms, authors,
entity_subscriptions or universal_subscriptions. Each keeps its
own shape, so check $group before rebuilding the array.
$postId is 0 for site-wide subscription products, which are not
tied to a post.
add_filter('fabrica_monetization_kit_purchase_options', function($options, $group, $postId) {
return $options;
}, 10, 3);Source: Paywall/PurchaseOptions.php:47
fabrica_monetization_kit_regwall_template
The finished registration-wall HTML — the “sign up to keep reading” screen — before it replaces the post body.
add_filter('fabrica_monetization_kit_regwall_template', function($html, $postId) {
return $html;
}, 10, 2);Source: Paywall.php:609
fabrica_monetization_kit_script_config
The data handed to the plugin’s front-end JavaScript as
fabricaMonetizationKitData — REST URLs, the Stripe publishable key,
what the current reader can see, and the interface strings.
It is printed into the page, so never add anything you would not show a logged-out visitor.
add_filter('fabrica_monetization_kit_script_config', function($config) {
return $config;
});Source: Paywall/ScriptConfig.php:128
Pricing
fabrica_monetization_kit_author_duration
How long access lasts after someone buys an author, in days. Zero means forever, which is the default.
add_filter('fabrica_monetization_kit_author_duration', function($duration, $authorId, $authorType) {
return $duration;
}, 10, 3);Source: AuthorPricing.php:307
fabrica_monetization_kit_author_price
What it costs to buy an author outright, in the smallest currency unit (pence for GBP), unlocking everything they have written.
$authorType is user or guest-author.
add_filter('fabrica_monetization_kit_author_price', function($price, $authorId, $authorType) {
return $price;
}, 10, 3);Source: AuthorPricing.php:279
fabrica_monetization_kit_author_purchasable
Whether this particular author is on sale. True for every author once author purchases are switched on, except those excluded in the admin.
$authorType is user or guest-author.
add_filter('fabrica_monetization_kit_author_purchasable', function($purchasable, $authorId, $authorType) {
return $purchasable;
}, 10, 3);Source: AuthorPricing.php:340
fabrica_monetization_kit_author_subscribable
Whether readers can subscribe to this author. True for every author once author subscriptions are switched on, except those excluded in the admin.
$authorType is user or guest-author.
add_filter('fabrica_monetization_kit_author_subscribable', function($subscribable, $authorId, $authorType) {
return $subscribable;
}, 10, 3);Source: AuthorPricing.php:357
fabrica_monetization_kit_enable_author_purchases
Whether readers can buy authors at all on this site. Overrides the Author purchases setting; false switches the feature off everywhere.
add_filter('fabrica_monetization_kit_enable_author_purchases', function($globalEnabled) {
return $globalEnabled;
});Source: AuthorPricing.php:325
fabrica_monetization_kit_price
The final price of anything the plugin sells, in the smallest currency unit (pence for GBP). This is the figure the reader is charged.
$entityType is post, term, author or subscription. Runs for
every kind of purchase, so check it before changing a price.
add_filter('fabrica_monetization_kit_price', function($price, $entityType, $objectSubtype, $entityId) {
return $price;
}, 10, 4);Source: Utils/PriceCalculator.php:70, Utils/PriceCalculator.php:84
fabrica_monetization_kit_term_duration
How long access lasts after someone buys a term bundle, in days. Zero means forever, which is the default.
add_filter('fabrica_monetization_kit_term_duration', function($duration, $termId, $taxonomy) {
return $duration;
}, 10, 3);Source: TermPricing.php:247
REST & Security
fabrica_monetization_kit_client_ip
The visitor’s IP address, used to group requests for rate limiting.
Behind Cloudflare or a load balancer every request looks like it comes from the proxy, which would rate-limit your whole audience as one visitor. Return the real client IP from the header your proxy sets — but only trust that header if the proxy overwrites it, or a visitor can forge it and slip the limit.
The value is 'unknown' when no valid IP is available.
add_filter('fabrica_monetization_kit_client_ip', function($ip, $request) {
return $ip;
}, 10, 2);Source: Services/RestRequestGuard.php:34, Services/RestRequestGuard.php:36
fabrica_monetization_kit_rate_limited
Fires when a request is turned away for hitting a rate limit, just before the 429 goes back. Useful for logging or alerting on suspicious traffic.
The single array argument carries action, scope (ip or
identity), ip, identity and limit.
add_action('fabrica_monetization_kit_rate_limited', function($value) {
// …
}, 10, 1);Source: Services/RestRequestGuard.php:106, Services/RestRequestGuard.php:124
fabrica_monetization_kit_rate_limits
How many requests each action allows before returning 429.
Keyed by action, each entry ['window' => seconds, 'max' => per-IP, 'identityMax' => per-account-or-email]. Raise the ceiling on a busy
site, lower it under attack, or add an entry for a custom action.
Return only what you want to change. Actions you leave out of the array keep their shipped limits, and so do individual keys you omit from an entry — nothing is disabled by absence, at either level.
To switch an action’s limit off you have to say so, by setting it to
false. That is deliberately the only way, because a limit removed
by accident is not visible until it is abused.
add_filter('fabrica_monetization_kit_rate_limits', function($defaults) {
return $defaults;
});Source: Services/RestRequestGuard.php:72
Settings
fabrica_monetization_kit_access_level_taxonomies
Which taxonomies may set a post’s access level, in order of authority. Overrides the Access level precedence setting.
Order matters: the first taxonomy in the list that has a level on a post decides that post’s level. Only worth setting when terms in more than one taxonomy carry levels and you need a tie-break — with an empty list, the strictest level found anywhere wins.
add_filter('fabrica_monetization_kit_access_level_taxonomies', function($stored) {
return $stored;
});Source: Settings.php:2089
fabrica_monetization_kit_access_products
Which subscription products count as granting access. Add retired or imported products here so long-standing subscribers keep working after you stop selling their plan.
Affects access checks only. The paywall still offers just the products in the settings, so adding one here does not put it back on sale.
add_filter('fabrica_monetization_kit_access_products', function($products) {
return $products;
});Source: Settings.php:2950
fabrica_monetization_kit_membership_product_ids
The products the membership block offers. Overrides the Membership products setting.
add_filter('fabrica_monetization_kit_membership_product_ids', function($products) {
return $products;
});Source: Settings.php:2930
fabrica_monetization_kit_metered_quota
How many posts a reader may read free each month before the wall
appears, on metered content. Defaults to the Metered quota
setting.
$userId is 0 for a logged-out visitor, who gets no free reads at
all — metered readers must register first, so the quota only applies
once they have. Use it to give different cohorts different
allowances.
add_filter('fabrica_monetization_kit_metered_quota', function($value, $userId, $postId) {
return $value;
}, 10, 3);Source: Settings.php:2348
fabrica_monetization_kit_rest_namespace
The namespace for the plugin’s REST routes, giving URLs like
/wp-json/fabrica-monetization-kit/v1/…. There is no setting for
this — code only.
Changing it moves the Stripe webhook endpoint, so update the URL in your Stripe dashboard to match or payments stop being recorded.
add_filter('fabrica_monetization_kit_rest_namespace', function($default) {
return $default;
});Source: Settings.php:2793
fabrica_monetization_kit_subscription_category_map
Tiered access: which taxonomy terms each subscription product unlocks. This is how you sell a basic and a premium tier off the same site.
Shape: [subscription_id => [taxonomy => [term_id, …]]]. The
subscription ID may be a Stripe Product or Price ID, or a
WooCommerce product or variation ID.
Returning a non-empty map switches the site to tiered access and hides the access-model choices in the admin. There is no setting for this — code only.
add_filter('fabrica_monetization_kit_subscription_category_map', function($value) {
return $value;
});Source: Settings.php:2847
fabrica_monetization_kit_subscription_category_map_locked
Force the access-model controls in the admin to defer to code.
Not usually needed: a non-empty
fabrica_monetization_kit_subscription_category_map already hides
them. Return true when you want them hidden even though your map
happens to match what is stored.
add_filter('fabrica_monetization_kit_subscription_category_map_locked', function($value) {
return $value;
});Source: Settings.php:2867
fabrica_monetization_kit_term_commerce_per_taxonomy
How each sellable taxonomy is sold, set from code instead of the settings screen.
Shape: [taxonomy => ['mode' => 'one_off'|'subscription'|'both'|'disabled', 'subscription_product' => product_id]]. Returning anything
different from what the settings would produce hides those
controls in the admin, so the screen never contradicts the code.
add_filter('fabrica_monetization_kit_term_commerce_per_taxonomy', function($built) {
return $built;
});Source: Settings.php:2251
fabrica_monetization_kit_term_commerce_per_taxonomy_locked
Force the term-commerce controls in the admin to defer to code.
Not usually needed: overriding
fabrica_monetization_kit_term_commerce_per_taxonomy already hides
them. Return true when you want them hidden even though your code
happens to produce the same result as the saved settings.
add_filter('fabrica_monetization_kit_term_commerce_per_taxonomy_locked', function($value) {
return $value;
});Source: Settings.php:2268
Subscriptions
fabrica_monetization_kit_content_date
The date a piece of content belongs to, deciding whether a date-based subscription covers it.
Return null to let the plugin work it out from the term meta or publication date. Return a date string, or an array of them, to override — an array is right where a post sits in several issues and any of them should unlock it.
add_filter('fabrica_monetization_kit_content_date', function($value, $contentId, $contentType) {
return $value;
}, 10, 3);Source: Utils/SubscriptionContentAccess.php:43
fabrica_monetization_kit_stripe_subscription_cached
Fires when a reader’s Stripe subscription has been re-read and cached against their account.
Happens on webhooks and on cache refreshes, so it is not a sign that
anything changed — for real lifecycle events use the
fabrica_monetization_kit_subscription_* actions instead.
add_action('fabrica_monetization_kit_stripe_subscription_cached', function($userId, $subscriptionData) {
// …
}, 10, 2);Source: Providers/ProviderStripeBilling.php:432
fabrica_monetization_kit_subscription_start_date
The date a subscription’s coverage starts, on a date-based site. Content published before it is not included.
The configured look-back has already been subtracted, which is what lets a new subscriber read a few weeks of back issues.
add_filter('fabrica_monetization_kit_subscription_start_date', function($startDate, $subscription) {
return $startDate;
}, 10, 2);Source: Utils/SubscriptionHelper.php:187
Text & Translation
fabrica_monetization_kit_text
Any customer-facing string in the plugin, so you can reword the whole interface without touching templates.
$key names the string, e.g. paywall.buy.heading; $context
carries whatever the caller knew at the time, often post_id and
access_level. Check $key and return your own copy, or return
$value unchanged.
To change one string without the $key check, use the per-key
filter below instead.
add_filter('fabrica_monetization_kit_text', function($value, $key, $context) {
return $value;
}, 10, 3);Source: Utils/Text.php:70
fabrica_monetization_kit_text_{$suffix}
One customer-facing string, named in the hook itself. Take the
string’s key and swap dots for underscores, so regwall.intro
becomes fabrica_monetization_kit_text_regwall_intro.
Saves checking $key yourself. Runs after the general
fabrica_monetization_kit_text filter, so both can be used at once.
add_filter('fabrica_monetization_kit_text_your_key', function($value, $context) {
return $value;
}, 10, 2);Source: Utils/Text.php:81
Webhooks
fabrica_monetization_kit_refund_processed
Fires once a refund has been applied: access withdrawn, campaign totals adjusted and any mirrored WooCommerce order updated.
Fires for partial refunds too, so check the charge before assuming the reader has lost access.
add_action('fabrica_monetization_kit_refund_processed', function($userId, $charge) {
// …
}, 10, 2);Source: Webhooks/StripeSubscriptionWebhook.php:705
fabrica_monetization_kit_stripe_webhook
Fires for every verified Stripe webhook event, after the plugin has finished with it. Use it to handle events the plugin ignores.
The signature has already been checked, so $event can be trusted.
The more specific subscription and refund actions are easier to work
with when one of those covers what you need.
add_action('fabrica_monetization_kit_stripe_webhook', function($event) {
// …
}, 10, 1);Source: Webhooks/StripeSubscriptionWebhook.php:314
fabrica_monetization_kit_subscription_created
Fires when someone subscribes for the first time. Use it to count new subscribers, send a welcome, or add them to a list.
Fires once per subscription and never for a change to an existing
one. A guest checkout fires it when confirmation creates the account,
which may be moments after the payment. The first payment may not
have cleared yet — wait for
fabrica_monetization_kit_subscription_renewed if you need money in
the bank.
add_action('fabrica_monetization_kit_subscription_created', function($userId, $subscription) {
// …
}, 10, 2);Source: Services/SubscriptionEvents.php:67
fabrica_monetization_kit_subscription_deleted
Fires when a subscription ends for good at Stripe. The reader has lost their subscriber access by this point, unless the site retains content they already paid for.
add_action('fabrica_monetization_kit_subscription_deleted', function($userId, $subscription) {
// …
}, 10, 2);Source: Webhooks/StripeSubscriptionWebhook.php:386
fabrica_monetization_kit_subscription_payment_failed
Fires when a subscription payment fails — usually an expired or declined card. Stripe will keep retrying, so this is the point to prompt the reader to update their details.
add_action('fabrica_monetization_kit_subscription_payment_failed', function($userId, $invoice) {
// …
}, 10, 2);Source: Webhooks/StripeSubscriptionWebhook.php:650
fabrica_monetization_kit_subscription_renewed
Fires when a subscription renewal is paid — every month or year a subscriber stays with you.
It also fires for the first payment, so count carefully if you are tracking renewals as distinct from sign-ups.
add_action('fabrica_monetization_kit_subscription_renewed', function($userId, $invoice) {
// …
}, 10, 2);Source: Webhooks/StripeSubscriptionWebhook.php:422
fabrica_monetization_kit_subscription_updated
Fires when a subscription is created or changed at Stripe and the reader’s cached copy has been brought up to date.
Covers upgrades, downgrades, pauses and cancellation-at-period-end,
and also fires on first subscribe — use
fabrica_monetization_kit_subscription_created if you only want new
subscribers. A subscription that has actually ended fires
fabrica_monetization_kit_subscription_deleted instead.
add_action('fabrica_monetization_kit_subscription_updated', function($userId, $subscription) {
// …
}, 10, 2);Source: Webhooks/StripeSubscriptionWebhook.php:362