Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Allow new posts and pages to be created #48

@westonruter

Description

@westonruter

In addition to editing existing posts, entirely new posts/pages should also be able to be created in the Customizer. There are two approaches we could go here:

(1) It could use the approach of creating new nav_menu_item posts where the pre-created post has a negative post ID which is used to designate a post that has not been inserted yet.
(2) Or it could actually create an auto-draft post in the DB which would give us a real ID to reference.

It would definitely be less complicated to implement (2), since all the DB queries would work in the preview without having to inject pseudo-posts into query results. However, I also like (1) because it is more philosophically pure in that it truly does not touch the DB before Save & Publish.

Once the technical architecture for representing a pre-created post is settled, there is then the question of the UI for creating these posts. One integration option is in Customizer Nav Menus via the Add Item UI (see #49). Another integration option is to extend the post type's panel to add a “New Post” button before the list of post sections (see #50).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions