@wp-playground/clientInterfacesRunPHPStepOn this pageRunPHPStep Runs PHP code. When running WordPress functions, the code key must first load wp-load.php and start with "<?php require_once 'wordpress/wp-load.php'; ".@hasRunnableExample@example<code>{ "step": "runPHP", "code": "<?php require_once 'wordpress/wp-load.php'; wp_insert_post(array('post_title' => 'wp-load.php required for WP functionality', 'post_status' => 'publish')); ?>"}</code>Index PropertiescodestepProperties codecode: stringThe PHP code to run.stepstep: runPHPThe step identifier.
Runs PHP code. When running WordPress functions, the
code
key must first loadwp-load.php
and start with"<?php require_once 'wordpress/wp-load.php'; "
.