Skip to content

Add import behavior controls and improve Substack content conversion#4

Merged
Ninodevo merged 6 commits into
trunkfrom
feat/import-options-featured-image-and-heading-fix
Apr 11, 2026
Merged

Add import behavior controls and improve Substack content conversion#4
Ninodevo merged 6 commits into
trunkfrom
feat/import-options-featured-image-and-heading-fix

Conversation

@Ninodevo

@Ninodevo Ninodevo commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

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

@zaerl zaerl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seem great to me. Good work!

@Ninodevo Ninodevo merged commit 2ea151b into trunk Apr 11, 2026
4 checks passed
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.

2 participants