Skip to content

Instantly share code, notes, and snippets.

@bgrgicak
Created June 3, 2025 11:46
Show Gist options
  • Save bgrgicak/d8995977f3fb4cd40041e257892a1392 to your computer and use it in GitHub Desktop.
Save bgrgicak/d8995977f3fb4cd40041e257892a1392 to your computer and use it in GitHub Desktop.
Bookmark Playground
{
"landingPage": "/",
"preferredVersions": {
"php": "8.3",
"wp": "6.8.1"
},
"phpExtensionBundles": [
"kitchen-sink"
],
"features": {
"networking": true
},
"login": true,
"steps": [
{
"step": "installTheme",
"themeData": {
"resource": "url",
"url": "https://github.com/bgrgicak/bookmark-playground/archive/refs/heads/main.zip"
},
"options": {
"activate": true
}
},
{
"step": "runPHP",
"code": "<?php require_once 'wordpress/wp-load.php'; foreach ( array( 'post', 'page', 'attachment', 'revision', 'nav_menu_item' ) as $post_type ) { $posts = get_posts( array('posts_per_page' => -1, 'post_type' => $post_type ) ); foreach ($posts as $post) wp_delete_post($post->ID, true); }"
},
{
"step": "runPHP",
"code": "<?php require_once 'wordpress/wp-load.php'; wp_insert_post( array( 'post_type' => 'page', 'post_title' => 'Bookmarks', 'post_content' => '<!-- wp:shortcode -->\n[add_bookmark_form]\n<!-- /wp:shortcode -->\n\n<!-- wp:shortcode -->\n[my_bookmarks]\n<!-- /wp:shortcode -->', 'post_status' => 'publish' ) );"
},
{
"step": "runPHP",
"code": "<?php require_once 'wordpress/wp-load.php'; wp_insert_post( array( 'post_type' => 'page', 'post_title' => 'Edit Bookmark', 'post_content' => '<!-- wp:shortcode -->\n[edit_bookmark_form]\n<!-- /wp:shortcode -->', 'post_status' => 'publish' ) );"
},
{
"step": "runPHP",
"code": "<?php require_once '/wordpress/wp-load.php'; wp_insert_post(array('post_title' => 'Playground docs', 'post_status' => 'publish', 'post_type' => 'bookmark', 'meta_input' => array( '_bookmark_url' => 'https://wordpress.github.io/wordpress-playground/', 'bookmark_url' => 'https://wordpress.github.io/wordpress-playground/' ))); ?>"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment