Skip to content

Add import behavior controls and improve Substack content conversion#4

Open
Ninodevo wants to merge 6 commits intotrunkfrom
feat/import-options-featured-image-and-heading-fix
Open

Add import behavior controls and improve Substack content conversion#4
Ninodevo wants to merge 6 commits intotrunkfrom
feat/import-options-featured-image-and-heading-fix

Conversation

@Ninodevo
Copy link
Contributor

@Ninodevo Ninodevo commented Mar 12, 2026

Summary

This PR improves the Substack import flow by adding new import controls.

What changed

  • Added new pre-import options to control import behavior:
    • Import all posts as draft.
    • Set the first imported image as featured image.
    • Choose publish date mode (original Substack date vs import date).
    • Apply a global taxonomy term (tag/category) to all imported posts.
  • Refactored import options rendering to use a dedicated partial (partials/substack-import-options.php) instead of inline HTML string assembly.
  • Updated importer admin logic to process these options and apply behavior consistently during import.
  • Improved converter behavior and fixtures for heading/content handling (including expected heading normalization behavior).
  • Added/updated PHPUnit coverage for:
    • Import options injection and request sanitization.
    • Import behavior application (status/date/meta/terms/featured-image queue).
    • Converter output expectations and related fixture scenarios.

Test plan

  • Run PHPUnit suite and confirm all tests pass.
  • Start an import and verify the new Substack Import Options block appears on the pre-import screen.
  • Verify each option works:
    • Draft mode imports posts as draft.
    • Featured image option queues/applies first image as thumbnail.
    • Publish date mode switches between original and import-time dates.
    • Global term option assigns selected tag/category to all imported posts.
  • Confirm heading conversion output matches expected Gutenberg blocks in imported content.

@Ninodevo Ninodevo requested a review from zaerl March 12, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant