From 32f17e1216030dc35412a049958d57e1e67d970a Mon Sep 17 00:00:00 2001 From: Janw Oostendorp Date: Fri, 6 Oct 2023 16:46:00 +0200 Subject: [PATCH] Improved documentation about including WP when running PHP (#649) Add `require_once "/wordpress/wp-load.php";` to Blueprint examples in the documentation to clarify how to call WordPress functions. --- README.md | 3 ++- .../docs/site/docs/09-blueprints-api/02-using-blueprints.md | 3 ++- packages/playground/blueprints/src/lib/steps/client-methods.ts | 2 +- packages/playground/client/README.md | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 067eb82632..4c6b4d5983 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,8 @@ You can connect to the Playground using the JavaScript client. Here's an example }); const response = await client.run({ - code: 'post_title;', }); console.log(response.text); diff --git a/packages/docs/site/docs/09-blueprints-api/02-using-blueprints.md b/packages/docs/site/docs/09-blueprints-api/02-using-blueprints.md index e1d4c3bd0a..c84abe3d71 100644 --- a/packages/docs/site/docs/09-blueprints-api/02-using-blueprints.md +++ b/packages/docs/site/docs/09-blueprints-api/02-using-blueprints.md @@ -73,7 +73,8 @@ You can also use Blueprints with the JavaScript API using the `startPlaygroundWe }); const response = await client.run({ - code: 'post_title;', }); console.log(response.text); diff --git a/packages/playground/blueprints/src/lib/steps/client-methods.ts b/packages/playground/blueprints/src/lib/steps/client-methods.ts index fea8001e2b..6249530394 100644 --- a/packages/playground/blueprints/src/lib/steps/client-methods.ts +++ b/packages/playground/blueprints/src/lib/steps/client-methods.ts @@ -10,7 +10,7 @@ import { fileToUint8Array } from './common'; * * { * "step": "runPHP", - * "code": "" + * "code": " 'wp-load.php required for WP functionality', 'post_status' => 'publish')); ?>" * } * */ diff --git a/packages/playground/client/README.md b/packages/playground/client/README.md index e3e368e989..539bd7e590 100644 --- a/packages/playground/client/README.md +++ b/packages/playground/client/README.md @@ -12,7 +12,8 @@ const client = await startPlaygroundWeb({ }); const response = await client.run({ - code: 'post_title;', }); console.log(response.text); ```