-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #158 from 10up/feature/plugin-preview
Add support for the WordPress.org plugin preview
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"$schema": "https://playground.wordpress.net/blueprint-schema.json", | ||
"landingPage": "\/wp-admin\/options-general.php?page=adstxt-settings", | ||
"preferredVersions": { | ||
"php": "7.4", | ||
"wp": "latest" | ||
}, | ||
"phpExtensionBundles": ["kitchen-sink"], | ||
"steps": [ | ||
{ | ||
"step": "login", | ||
"username": "admin", | ||
"password": "password" | ||
}, | ||
{ | ||
"step": "setSiteOptions", | ||
"options": { | ||
"permalink_structure": "\/%25postname%25\/" | ||
} | ||
}, | ||
{ | ||
"step": "installPlugin", | ||
"pluginZipFile": { | ||
"resource": "wordpress.org\/plugins", | ||
"slug": "ads-txt" | ||
}, | ||
"options": { | ||
"activate": true | ||
} | ||
}, | ||
{ | ||
"step": "runPHP", | ||
"code": "<?php require_once 'wordpress\/wp-load.php'; $adstxt_id = wp_insert_post( array( 'post_title' => 'Ads.txt', 'post_content' => '# Example information\n[email protected]\n\n# Example record\ngoogle.com, pub-1234567890, DIRECT, f08c47fec0942fa0', 'post_status' => 'publish', 'post_type' => 'adstxt' ) ); $app_adstxt_id = wp_insert_post( array( 'post_title' => 'App-ads.txt', 'post_content' => '# Example information\n[email protected]\n\n# Example record\ngoogle.com, pub-1234567890, DIRECT, f08c47fec0942fa0', 'post_status' => 'publish', 'post_type' => 'app-adstxt' ) ); if ( ! $adstxt_id instanceof WP_Error ) { update_option( 'adstxt_post', (int) $adstxt_id ); } if ( ! $app_adstxt_id instanceof WP_Error ) { update_option( 'app_adstxt_post', (int) $app_adstxt_id ); }" | ||
} | ||
] | ||
} |