Skip to content

Create a new router for presenting new post editor - #25838

Open
crazytonyli wants to merge 11 commits into
trunkfrom
bugfix/new-post-presentation-refactor
Open

Create a new router for presenting new post editor#25838
crazytonyli wants to merge 11 commits into
trunkfrom
bugfix/new-post-presentation-refactor

Conversation

@crazytonyli

@crazytonyli crazytonyli commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Note

I recommend reviewing this PR commit by commit.

Description

Follow-up of #25830

This PR centralizes new post and page creation in PostEditorRouter, which chooses the right editor, the Core REST editor (for editing wprs backed post) or the legacy editor (for editing AbstractPost), based on the site.

NewPostEditorContext carries prefilled content, tags, media, blogging prompts, page layouts, analytics attribution, and dismissal behavior across both editor paths. Existing-object editing remains on the legacy path.

Testing instructions

  • On a self-hosted site with XML-RPC disabled, create posts and pages from the FAB and the Posts and Pages lists. Verify the Core REST editor opens.
  • Try a prefilled flow, such as a blogging prompt or media flow, and verify its content is preserved.
  • Repeat on a WordPress.com site or a self-hosted site with XML-RPC enabled. Verify the legacy editor still opens.
  • Open an existing post and verify it still uses the legacy path.

@dangermattic

dangermattic commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

rootViewPresenter.showPostEditor(animated: false)
rootViewPresenter.showNewPostEditor(
context: NewPostEditorContext(
analytics: .editorCreatedPost(source: "create_button", postType: "post"),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I kept the original analytic events, but open to update them if needed.

@crazytonyli
crazytonyli marked this pull request as ready for review July 24, 2026 06:00
@wpmobilebot

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number33448
VersionPR #25838
Bundle IDorg.wordpress.alpha
Commit4e8a716
Installation URL6ods1nqj3p46g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number33448
VersionPR #25838
Bundle IDcom.jetpack.alpha
Commit4e8a716
Installation URL766dnar2o07i0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants