Add filters for paywall content customization#1
Merged
Ninodevo merged 3 commits intoWordPress:trunkfrom Feb 11, 2026
Merged
Conversation
zaerl
approved these changes
Feb 11, 2026
Contributor
zaerl
left a comment
There was a problem hiding this comment.
This LGTM, great work.
I've seen you have bumped the version to 1.2.0. Remember to change it on:
readme.txtsubstack-importer.phppackage.json
This can be done in another PR.
| * | ||
| * This filter allows modification of the converted Gutenberg block content | ||
| * before it is added to the WXR. Useful for wrapping paywalled content in | ||
| * custom blocks (e.g., membership plugins). |
Contributor
Author
|
Thanks @zaerl! I will bump the version in those files and add more features to the 1.2.0 release before deploying |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds three new filters to make the Substack Importer more extensible, particularly for handling paywalled content conversion. These filters allow developers to customize how paywall markers are displayed and how paywalled content is processed during import, enabling integration with membership plugins and other custom paywall solutions.
Changes
substack_importer_paywall_marker_textfilter: Allows customization of the paywall marker text that appears in imported content.substack_importer_paywall_contentfilter: Allows complete override of the paywall block conversion process, enabling custom block types or markup.substack_importer_post_content_after_conversionfilter: Allows modification of post content after Gutenberg conversion but before it's added to the WXR. This is particularly useful for wrapping paywalled content in custom membership blocks.Testing Instructions
Test 1: Custom Paywall Marker Text
functions.phpor a custom plugin:Test 2: Custom Paywall Block Conversion
Test 3: Wrap Paywalled Content in Custom Block
Test 4: Verify Default Behavior (No Filters)
Unit Testing
Run the PHPUnit test suite to verify all filter functionality.