Opened 6 years ago
Last modified 6 years ago
#44891 new defect (bug)
Activate button showing after theme activated
Reported by: | anilhada | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.9.8 |
Component: | Themes | Keywords: | has-screenshots has-patch needs-testing |
Focuses: | ui, administration | Cc: |
Description
How to get bug:-
First go on
Appearance - > Theme
After that active theme i will go on next page add new theme on this page my activated
theme showing again active button.
Attachments (7)
Change History (15)
#2
@
6 years ago
- Summary changed from Active button showing after theme activeted to Activate button showing after theme activated
#5
@
6 years ago
Thanks for the report @anilhada, this looks like a good find.
@mukesh27 That looks like a good starting point.
I wonder if we could adjust it some more:
featured-themes-with-active-theme-shown.jpg is a suggestion that displayes the "Active" theme in a similar way as in the current list of installed-themes.jpg.
The patch in 44891.2.diff makes data.active
available in the Backbone micro template via the wp_ajax_query_themes()
function with:
$theme->active = ( $theme->slug === $current_theme );
where we use $current_theme = get_stylesheet()
as we have in wp_prepare_themes_for_js()
.
It also makes some adjustments to the Backbone micro templates.
#6
@
6 years ago
44891.3.diff re-adds a missing $aria_label
from 44891.2.diff.
We're also using an existing translation string:
printf( __( '<span>Active:</span> %s' ), '{{{ data.name }}}' );
but I wonder if we should try to remove the HTML from it?
Regarding the naming convention:
I wonder if instead of data.active
it would be more explicit to use data.isActive
for the boolean values? But data.active
seems to be currently used in core, but we also have data.isHueSlider
and data.data.isCreating
.
We also have data.installed
in core, then should we use data.activated
instead of data.active
?
Try this patch.