Skip to content

Commit 591b34c

Browse files
committed
[PHP Playground] Include WordPress in the default code example
1 parent 9262f1f commit 591b34c

File tree

1 file changed

+7
-27
lines changed

1 file changed

+7
-27
lines changed

packages/playground/website/public/php-playground.html

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -474,26 +474,6 @@ <h2>✨ WordPress PHP Playground ✨</h2>
474474

475475
<h2>💡 Tips</h2>
476476
<ul>
477-
<li>
478-
<strong>🌟 WordPress is available!</strong> Run
479-
<code>require '/wordpress/wp-load.php';</code> to
480-
load the latest WordPress release. For example:
481-
<pre
482-
style="
483-
background: #f5f5f5;
484-
padding: 8px;
485-
margin: 8px 0;
486-
border-radius: 4px;
487-
font-size: 13px;
488-
overflow-x: auto;
489-
"
490-
><code>&lt;?php
491-
require '/wordpress/wp-load.php';
492-
493-
$html_processor = WP_HTML_Processor::create_fragment('&lt;p>&lt;span>Hey!&lt;/span>&lt;/p>');
494-
$html_processor->next_tag();
495-
var_dump($html_processor->get_tag());</code></pre>
496-
</li>
497477
<li>
498478
<strong>🔗 Embed in your app:</strong> You can embed
499479
this playground in an iframe to provide interactive
@@ -734,15 +714,15 @@ <h2>💡 Tips</h2>
734714
restorePHPVersionFromURL();
735715

736716
const defaultCode = `<?php
737-
// Welcome to PHP Playground!
738-
$message = "Hello from PHP " . phpversion();
739-
echo $message;
717+
echo "Hello from PHP " . phpversion();
718+
echo "<br>";
740719
741-
function greet($name) {
742-
return "Hello, " . $name . "!";
743-
}
720+
// WordPress is available if you need it!
721+
require '/wordpress/wp-load.php';
744722
745-
echo greet("World");
723+
$html_processor = WP_HTML_Processor::create_fragment('<p><span>Hey!</span></p>');
724+
$html_processor->next_tag();
725+
var_dump($html_processor->get_tag());
746726
?>`;
747727

748728
// Load initial state from URL

0 commit comments

Comments
 (0)