WordPress / WordPress/php-toolkit
Blueprints: Redirect to a post created inside of a Blueprint
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 61
- Forks
- 21
- Avg merge
- 19h 34m
- Merged PRs (30d)
- 7
Description
There is no convenient way of creating a post inside of a Blueprint and then redirecting the user to the post editor with that post opened.
For example, the Blueprint in block-development-examples#75 had to rely on a hardcoded post ID:
{
"landingPage": "/wp-admin/post.php?post=4&action=edit",
"steps": [
// ... other steps ...
{
"step": "runPHP",
"code": "<?php require '/wordpress/wp-load.php'; wp_insert_post( array('post_title' => 'Test block','post_content' => '<!-- wp:block-development-examples/basic-esnext-a2ab62 --><div style=\"background-color:#900;color:#fff;padding:20px\" class=\"wp-block-block-development-examples-basic-esnext-a2ab62\">Hello World, step 1 (from the frontend).</div><!-- /wp:block-development-examples/basic-esnext-a2ab62 -->', 'post_status' => 'publish', 'post_author' => 1 ) );"
}
]
}
Let's add support for that. How? I'm not sure at this point – it will take some discussions and explorations.
Done is
- Blueprints offer a way of redirecting to a resource created inside of a Blueprint
FYI @dawidurbanski
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the Blueprint example in block-development-examples#75 and the runPHP step that creates the post. Determine how a created resource can be captured and used by landingPage, then verify that a Blueprint can redirect to the resulting post editor without a hardcoded ID.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100