wordpress-playground icon indicating copy to clipboard operation
wordpress-playground copied to clipboard

RunPHPWithOptionsStep demo returns nothing

Open flexseth opened this issue 1 year ago • 2 comments

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 avatar Mar 30 '24 03:03 flexseth

Error

Error: Invalid blueprint: must have required property 'code' at /steps/0
    at compileBlueprint

flexseth avatar Mar 30 '24 04:03 flexseth

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 avatar May 17 '24 05:05 stgeer

Can this one be assigned to me pls?

stgeer avatar May 17 '24 05:05 stgeer

Can this one be assigned to me pls?

Sure, thank you for helping :slightly_smiling_face:

bgrgicak avatar May 17 '24 06:05 bgrgicak