Skip to content

Instantly share code, notes, and snippets.

@SirLouen
Last active December 26, 2025 23:29
Show Gist options
  • Select an option

  • Save SirLouen/5bcbda3c170fabae7174ac49c3cc19a2 to your computer and use it in GitHub Desktop.

Select an option

Save SirLouen/5bcbda3c170fabae7174ac49c3cc19a2 to your computer and use it in GitHub Desktop.
Test 74228
{
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
"preferredVersions": {
"php": "8.3",
"wp": "trunk"
},
"features": {
"networking": true
},
"landingPage": "/wp-admin/edit.php",
"login": true,
"steps": [
{
"step": "runPHP",
"code": "<?php require '/wordpress/wp-load.php'; $tags = ['development', 'gutenberg', 'blocks', 'php', 'javascript', 'css', 'wordpress', 'themes', 'plugins', 'performance', 'accessibility', 'react', 'api', 'database', 'security', 'testing', 'design', 'frontend', 'backend', 'seo', 'content', 'editor', 'customize', 'hooks', 'filters', 'queries', 'templates', 'shortcodes', 'widgets', 'menus', 'users']; foreach($tags as $tag) { wp_insert_term($tag, 'post_tag'); } ?>"
},
{
"step": "runPHP",
"code": "<?php require '/wordpress/wp-load.php'; $titles = ['First Post', 'Development Notes', 'Gutenberg Testing', 'PHP Patterns', 'Block Editor Tips', 'Theme Development', 'Plugin Architecture', 'Performance Guide', 'Accessibility Best Practices', 'React in WordPress']; $contents = ['<!-- wp:paragraph --><p>Sample content with paragraphs and headings for testing.</p><!-- /wp:paragraph --><!-- wp:heading --><h2>Testing section</h2><!-- /wp:heading -->', '<!-- wp:paragraph --><p>Development focused content with code blocks.</p><!-- /wp:paragraph --><!-- wp:code --><pre>function example() {}</pre><!-- /wp:code -->']; for($i=0; $i<10; $i++) { $post_id = wp_insert_post(['post_title' => $titles[$i % count($titles)], 'post_content' => $contents[array_rand($contents)], 'post_status' => 'publish', 'post_author' => 1]); $all_tags = get_terms(['taxonomy' => 'post_tag', 'hide_empty' => false]); $tag_ids = array_rand($all_tags, 3); $tag_ids = array_map(function($index) use($all_tags){return $all_tags[$index]->term_id;}, is_array($tag_ids) ? $tag_ids : [$tag_ids]); wp_set_post_tags($post_id, $tag_ids); } ?>"
},
{
"step": "runPHP",
"code": "<?php require '/wordpress/wp-load.php'; $content = '<!-- wp:paragraph -->\\n<p>List of cloud tags</p>\\n<!-- /wp:paragraph -->\\n\\n<!-- wp:tag-cloud -->\\n<!-- /wp:tag-cloud -->\\n\\n<!-- wp:paragraph -->\\n<p>Another paragraph</p>\\n<!-- /wp:paragraph -->'; wp_insert_post(['post_title' => 'Cloud Tags test', 'post_content' => $content, 'post_status' => 'publish', 'post_author' => 1]); ?>"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment