Opened 7 weeks ago
Last modified 13 days ago
#64729 new defect (bug)
Missing “Live Preview” button for block themes after installation on the “Add Themes” screen
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 7.1 | Priority: | normal |
| Severity: | normal | Version: | 6.9 |
| Component: | Themes | Keywords: | has-patch |
| Focuses: | Cc: |
Description
On the Add Themes screen (wp-admin/theme-install.php), when installing themes from search results or browsing via tabs/filters, the first theme card does not display the "Live Preview" button after installation completes.
Only the "Activate" button is shown for the first installed theme card. All subsequent installed theme cards correctly display both "Activate" and "Live Preview" buttons.
This issue occurs consistently across:
- Search results
- Popular tab
- New tab
- Block Themes tab
- Feature Filter results
Steps to Reproduce:
- Log into the WordPress administration dashboard.
- Navigate to Appearance → Themes → Add New Theme.
- Use any of the following:
- Search for a keyword (e.g., "hello"), OR
- Click the Popular tab, OR
- Click the New tab, OR
- Click the Block Themes tab, OR
- Apply any Feature Filter.
- On the first theme card in the results, click the Install button.
- Wait for the installation to complete.
- Observe that the button updates to "Activate", but there is no "Live Preview" button.
- Install the second theme in the results list.
- Wait for the installation to complete.
- Observe that both the "Activate" and "Live Preview" buttons are correctly displayed.
Expected Results:
All installed theme cards in the results should display both:
- Activate
- Live Preview
Actual Results:
The first theme card only displays:
- Activate
The "Live Preview" button is missing.
Subsequent installed theme cards correctly display both buttons.
Attachments (2)
Change History (15)
#2
@
7 weeks ago
There was an issue until 6.9 in which the Live Preview button was missing for block themes, so this may be related. See #64159.
@
7 weeks ago
@westonruter You’re right. I’m seeing this issue not just on the first card, The Live Preview button is missing across for block theme.
#3
@
7 weeks ago
- Summary changed from Missing "Live Preview" button on the first theme card after installation in "Add Themes" screen to Missing “Live Preview” button for block themes after installation on the “Add Themes” screen
#4
@
7 weeks ago
I tested this locally on WordPress 7.0 Beta 1, and the issue is still reproducible. After installing block themes from the Add Themes screen, the “Live Preview” button is missing for every theme card and only the “Activate” button appears.
I’ve attached a screenshot for reference.
https://prnt.sc/fqb4sBphp2zj
#5
@
7 weeks ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 7.0
- Version set to 6.9
Curious that this seems to be a regression from 6.9.
@huzaifaalmesbah @madhavishah01 Are you able to reproduce the issue in 6.9?
#6
@
7 weeks ago
Reproduction Report
Environment
- WordPress: 6.9.1
- PHP: 8.2.30
- Server: nginx/1.29.4
- Database: mysqli (Server: 9.5.0 / Client: mysqlnd 8.2.30)
- Browser: Chrome 145.0.0.0
- OS: macOS
- Theme: Twenty Twenty-Five 1.4
- MU Plugins: None activated
- Plugins:
- Test Reports 1.2.1
Steps taken
- Navigate to Appearance → Themes → Add New Theme.
- Use any of the following:
- Click the Block Themes tab, OR
- Search for a keyword (e.g., "hello")
- click the Install button.
- Wait for the installation to complete.
- Observe that the button updates to "Activate", but there is no "Live Preview" button.
- 🐞 Bug occurs
Screenshots/Screencast with results
- Screencast: https://files.catbox.moe/uoea8n.mp4
#7
follow-up:
↓ 8
@
7 weeks ago
On the theme installation page, [52819] intentionally removed the Live Preview links for any block themes (backported to 5.9.3). See #54878 and theme-install.php.
#8
in reply to:
↑ 7
@
7 weeks ago
Replying to sabernhardt:
On the theme installation page, [52819] intentionally removed the Live Preview links for any block themes (backported to 5.9.3). See #54878 and theme-install.php.
@sabernhardt Thanks for pointing this out and for the reference. I’m just curious about the inconsistency, before installing a block theme, the Preview button is visible, but after installation the Live Preview button disappears (only Activate shows).
Meanwhile, classic themes still show Live Preview after installation on the same page. This feels a bit inconsistent and potentially confusing from a UX perspective.
This ticket was mentioned in PR #11184 on WordPress/wordpress-develop by @sanket.parmar.
6 weeks ago
#9
- Keywords has-patch added; needs-patch removed
## Description
After installing a block theme from Appearance → Themes → Add New Theme, the "Preview" button was missing — only "Activate" appeared. Classic themes correctly showed both "Activate" and "Live Preview". This inconsistency was present across all tabs and search results.
The root cause is threefold:
wp_ajax_install_theme()was always sendingcustomizeUrlpointing to the classic Customizer (customize.php) for all themes, including block themes. Block themes don't support the Customizer, so the button was either broken or absent.
wp_ajax_query_themes()(the on-load data for all theme cards) was sendingsite-editor.phpfor installed block themes, but without thewp_theme_preview=<slug>query parameter. Without it, clicking Preview would open the Site Editor for the *currently active* theme instead of the selected one.
- The Underscore.js template in
theme-install.phphad a blanket<# if ( ! data.block_theme ) { #>guard added by #54878 in 2022 to prevent pointing block themes at the Customizer. That suppression was never updated after context-aware Site Editor preview URLs became available.
---
## Changes
wp-admin/includes/ajax-actions.php — two functions:
wp_ajax_install_theme(): For block themes, sendssite-editor.php?wp_theme_preview=<slug>&return=...instead of the classic Customizer URL. Mirrors the existing logic inclass-theme-installer-skin.phpused by the non-AJAX full-page install path. Capability check also broadened to allow block themes regardless of thecustomizecap.wp_ajax_query_themes(): Addswp_theme_preview=<slug>to the Site Editor URL for already-installed block themes shown on page load, so the button actually previews the correct theme.
wp-admin/theme-install.php:
- Replaces the blanket block-theme suppression with an explicit branch: block themes render a plain
Previewlink (noload-customize); classic themes keepLive Previewwithload-customize.
js/_enqueues/wp/updates.js:
installThemeSuccess(): Checksresponse.blockThemewhen replacing the.previewbutton post-install. Block themes get a plainPreview<a>without theload-customizeclass (which triggers Customizer-specific JS); classic themes are unchanged.
---
## Testing Instructions
Prerequisites: A WordPress install with at least one classic theme and one block theme available but not yet installed.
### Block theme — AJAX install path
- Go to Appearance → Themes → Add New Theme.
- Search for a block theme (e.g. "Twenty Twenty-Four") or open the Block Themes tab.
- Click Install on any block theme that is not yet installed.
- Wait for installation to complete.
- Both Activate and Preview buttons should appear immediately.
- Click Preview — it should open the Site Editor with that theme previewed, not the Customizer.
### Classic theme — AJAX install path
- On the same screen, install a classic theme (e.g. "Twenty Twenty").
- Both Activate and Live Preview buttons should appear.
- Click Live Preview — it should open the Customizer with that theme.
### Already-installed block theme cards (page-load path)
- Install a block theme via any method and do not activate it.
- Return to Appearance → Themes → Add New Theme and browse any tab.
- Find the installed block theme card.
- The card should show Activate and Preview.
- Click Preview — it should open the Site Editor previewing that specific theme, not the currently active one.
### No regression — full-page install path
- Navigate directly to
wp-admin/update.php?action=install-theme&theme=<slug>(non-AJAX install). - Post-install buttons remain correct — this path was already working via
class-theme-installer-skin.php.
### Active block theme
- Activate a block theme.
- Go to Add New Theme and find the active theme's card.
- It should show Activated (disabled) and Customize (linking to the Site Editor) — unchanged behaviour.
---
Trac ticket: https://core.trac.wordpress.org/ticket/64729
---
## Use of AI Tools
@audrasjb commented on PR #11184:
4 weeks ago
#10
This PR fixes the issue on my side.
screen-capture (9).webm
@rcorrales commented on PR #11184:
4 weeks ago
#11
Tested this locally and the fix works as expected. Block themes now correctly show the Preview button after installation, and clicking it opens the Site Editor with the right theme previewed via wp_theme_preview.
One small thing I noticed is that the PR labels the block theme button "Preview" (in both theme-install.php and updates.js), but classic themes on the same screen show "Live Preview".
The other screens that handle this (themes.php, class-theme-installer-skin.php, class-theme-upgrader-skin.php) all use "Live Preview" for block themes too. Is "Preview" intentional here, or can it be changed to "Live Preview" for consistency?
#12
@
4 weeks ago
- Milestone changed from 7.0 to 7.1
As we're a few hours from 7.0 RC1, I'm moving this ticket to milestone 7.1 to give this more time for testing.
@sanket.parmar commented on PR #11184:
13 days ago
#13
Hi, @rbcorrales
Good catch, thanks! You're right — themes.php and class-theme-installer-skin.php both use "Live Preview" for block themes, so "Preview" was inconsistent. Updated both theme-install.php and updates.js to use "Live Preview" across the board. The block theme button still intentionally omits the load-customize class (to avoid triggering Customizer-specific JS), but the label is now consistent with the rest of the codebase.


Video demonstrating the issue: https://files.catbox.moe/7v98br.mp4