[wp-trac] [WordPress Trac] #60194: Add Preview in Playground buttons to plugin install screens
WordPress Trac
noreply at wordpress.org
Fri Jan 5 04:40:56 UTC 2024
#60194: Add Preview in Playground buttons to plugin install screens
-----------------------------+-----------------------------
Reporter: tellyworth | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Plugins | Version: trunk
Severity: normal | Keywords:
Focuses: |
-----------------------------+-----------------------------
Proposal: add Preview buttons to plugin install screens within wp-admin.
Background:
The WordPress.org Plugin Directory now supports a Live Preview feature
based on Playground; see https://meta.trac.wordpress.org/ticket/7251 for
context.
You can see an example working on the https://wordpress.org/plugins
/convert-to-blocks/ plugin. Previews are currently only enabled on plugins
where the developer has opted in and provided a blueprint.json file (which
provides setup and configuration info).
The preview button on the web site works simply by redirecting from
`https://wordpress.org/plugins/PLUGIN-SLUG/?preview=1` to a
`playground.wordpress.net` URL which loads the plugin's blueprint file. It
opens the playground URL in a new window using `target="_blank"`.
I'm proposing that we do essentially the same thing from within wp-admin,
on screens with an Install button for plugins: add a Preview button, which
opens `https://wordpress.org/plugins/PLUGIN-SLUG/?preview=1` in a new
window.
The wordpress.org plugins API already returns a `preview_link` property
containing the appropriate URL for plugins with a working preview.
I'll attach a diff with a minimal implementation; this is intended as a
starting point for testing and discussion, not a finished patch in its
current state.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60194>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list