{
    "$schema": "https://playground.wordpress.net/blueprint-schema.json",
    "landingPage": "/wp-admin/edit.php",
    "preferredVersions": {
        "php": "8.2",
        "wp": "latest"
    },
    "phpExtensionBundles": [
        "kitchen-sink"
    ],
    "steps": [
        {
            "step": "login",
            "username": "admin",
            "password": "password"
        },
        {
            "step": "installPlugin",
            "pluginData": {
                "resource": "wordpress.org/plugins",
                "slug": "acato-readable-list-tables"
            },
            "options": {
                "activate": true
            }
        },
        {
            "step": "writeFile",
            "path": "/wordpress/wp-content/mu-plugins/rlt-preview-columns.php",
            "data": "<?php\n/**\n * Plugin Name: Acato Readable List Tables - preview extras\n * Description: Only loaded in the WordPress Playground preview. Adds the kind\n *              of columns SEO, expiry and duplication plugins bolt onto the\n *              post overview, so there is something for this plugin to fix.\n */\n\ndefined( 'ABSPATH' ) || exit;\n\nfunction rlt_preview_columns() {\n\treturn array(\n\t\t'rlt-preview-seo-title' => 'SEO title',\n\t\t'rlt-preview-metadesc'  => 'Meta description',\n\t\t'rlt-preview-keyphrase' => 'Focus keyphrase',\n\t\t'rlt-preview-score'     => 'SEO score',\n\t\t'rlt-preview-links'     => 'Internal links',\n\t\t'rlt-preview-expires'   => 'Expires',\n\t\t'rlt-preview-original'  => 'Original item',\n\t\t'rlt-preview-template'  => 'Template',\n\t\t'rlt-preview-reviewer'  => 'Reviewer',\n\t\t'rlt-preview-language'  => 'Language',\n\t);\n}\n\nadd_filter(\n\t'manage_post_posts_columns',\n\tfunction ( $columns ) {\n\t\treturn array_merge( $columns, rlt_preview_columns() );\n\t}\n);\n\nadd_action(\n\t'manage_post_posts_custom_column',\n\tfunction ( $column, $post_id ) {\n\t\t$labels = rlt_preview_columns();\n\n\t\tif ( isset( $labels[ $column ] ) ) {\n\t\t\techo esc_html( $labels[ $column ] . ' for #' . $post_id );\n\t\t}\n\t},\n\t10,\n\t2\n);\n"
        },
        {
            "step": "runPHP",
            "code": "<?php require_once 'wordpress/wp-load.php'; $titles = array( 'Acato Readable List Tables gives every column a real width', 'Scroll sideways with the bar at the bottom of the window', 'The checkbox and title columns stay pinned', 'Quick Edit stays in view while the table is scrolled', 'Hide columns through Screen Options to make it fit', 'A post with a rather long title, to show the title column no longer collapses', 'Categories, tags and dates keep a sensible width', 'Columns from unknown plugins get a width too' ); foreach ( $titles as $title ) { wp_insert_post( array( 'post_title' => $title, 'post_status' => 'publish', 'post_content' => 'Preview content.' ) ); }"
        }
    ]
}
