Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sejas/playground-plugin-admin-notice
Basic plugin example to display a notice inside WordPress admin
https://github.com/sejas/playground-plugin-admin-notice
wordpress wordpress-playground wordpress-plugin
Last synced: 2 months ago
JSON representation
Basic plugin example to display a notice inside WordPress admin
- Host: GitHub
- URL: https://github.com/sejas/playground-plugin-admin-notice
- Owner: sejas
- Created: 2023-12-03T10:37:01.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-05T15:36:12.000Z (5 months ago)
- Last Synced: 2024-10-09T23:21:58.491Z (3 months ago)
- Topics: wordpress, wordpress-playground, wordpress-plugin
- Language: PHP
- Homepage: https://sejas.es/playground/admin-notice
- Size: 321 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Playground Plugin Admin Notice
Basic example demonstrating how to display an admin notice inside the WordPress Playground.
This repository includes the [plugin source code](playground-plugin-admin-notice), the [plugin ZIP file](playground-plugin-admin-notice.zip), the default [blueprint.json](blueprint.json), and the [blueprint-override-message.json](blueprint-override-message.json) for overriding the default message.
![Screenshot](screenshot.png)
## How to use
This repository is designed for using the `raw` GitHub URLs to load both the plugin and the blueprint into the WordPress Playground.
### WordPress Playground URLs
- Loading the blueprint as URL fragment: [`https://playground.wordpress.net/#{"landingPage":"/wp-admin/","steps":[{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://raw.githubusercontent.com/sejas/playground-plugin-admin-notice/main/playground-plugin-admin-notice.zip"}},{"step":"login","username":"admin","password":"password"}]}`](https://playground.wordpress.net/#{"landingPage":"/wp-admin/","steps":[{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://raw.githubusercontent.com/sejas/playground-plugin-admin-notice/main/playground-plugin-admin-notice.zip"}},{"step":"login","username":"admin","password":"password"}]})
### Override notice message using site options
- Display a custom message: [`https://playground.wordpress.net/#{"landingPage":"/wp-admin/","steps":[{"step":"setSiteOptions","options":{"playground_admin_notice":"This is a custom message."}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://raw.githubusercontent.com/sejas/playground-plugin-admin-notice/main/playground-plugin-admin-notice.zip"}},{"step":"login","username":"admin","password":"password"}]}`](https://playground.wordpress.net/#{"landingPage":"/wp-admin/","steps":[{"step":"setSiteOptions","options":{"playground_admin_notice":"This%20is%20a%20custom%20message."}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://raw.githubusercontent.com/sejas/playground-plugin-admin-notice/main/playground-plugin-admin-notice.zip"}},{"step":"login","username":"admin","password":"password"}]})
**Blueprint for displaying a custom message**
```json
{
"landingPage": "/wp-admin/",
"steps": [
{
"step": "setSiteOptions",
"options": {
"playground_admin_notice": "This is a custom message."
}
},
{
"step": "installPlugin",
"pluginZipFile": {
"resource": "url",
"url": "https://raw.githubusercontent.com/sejas/playground-plugin-admin-notice/main/playground-plugin-admin-notice.zip"
}
},
{
"step": "login",
"username": "admin",
"password": "password"
}
]
}
```### How to contribute
Please feel welcome to open an issue or submit a pull request if you have any suggestions for improvements or modifications.