WordPress / wordpress-playground

Run WordPress in the browser via WebAssembly PHP
https://w.org/playground/
GNU General Public License v2.0
1.62k stars 249 forks source link

RunPHPWithOptionsStep demo returns nothing #1162

Open flexseth opened 6 months ago

flexseth commented 6 months ago

No content on demo

https://wordpress.github.io/wordpress-playground/blueprints-api/steps/#RunPHPWithOptionsStep

image

Neither Blueprint API or function API demos are working

flexseth commented 6 months ago

Error

Error: Invalid blueprint: must have required property 'code' at /steps/0
    at compileBlueprint
stgeer commented 4 months ago

I think this issue is caused by the code key, according to the documentation it should start with "<?php require_once 'wordpress/wp-load.php'; ".

Therefore the request should be updated as follows:

{
    "steps": [
        {
            "step": "runPHP",
            "options": {
                "code": "<?php require_once 'wordpress/wp-load.php'; ?php echo $_SERVER['CONTENT_TYPE']; ?>",
                "headers": {
                    "Content-type": "text/plain"
                }
            }
        }
    ]
}

It should then return a successful response.

stgeer commented 4 months ago

Can this one be assigned to me pls?

bgrgicak commented 4 months ago

Can this one be assigned to me pls?

Sure, thank you for helping :slightly_smiling_face: