From a plugin settings page? You can collect form data from the page and consolidate into an appropriate data array, which is then passed to wp_insert_post()
. The page’s code could discern whether it’s getting a POST or GET request. If GET, just display the form with any current post data. If POST, collect submitted data and pass to the function.
Your page can put up a tinyMCE editor by calling wp_editor()
. Not sure how you’d accomplish the block editor on a plugin page.
It could be tricky getting users who want to add such posts to your form instead of the usual edit-form-advanced.php page. The list table action links and admin menu links can be modified. Last I checked, the Add New button at the top of the list table isn’t easily altered in PHP. It may require JavaScript to change its link.
IMO you’re better off modifying the edit-from-advanced.php page for your post type. It’s where users would naturally go to create posts of any type. It’s all meta box based, so you can add or remove boxes as desired. For examples on what’s possible, check out the Advanced Custom Fields plugin. The default editor can be suppressed and various custom fields can be added. Its source code could serve as guidance towards your own efforts you should choose to modify the default post edit page instead of making a custom plugin page.