WordPress.org

Make WordPress Core

Opened 16 months ago

Last modified 16 months 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:
PR Number:

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)

Screenshot_2.png (409.5 KB) - added by anilhada 16 months ago.
44891.patch (676 bytes) - added by mukesh27 16 months ago.
Try this patch.
active-theme-link-after-patch.png (1.2 MB) - added by mukesh27 16 months ago.
44891.2.diff (4.0 KB) - added by birgire 16 months ago.
featured-themes-with-active-theme-shown.jpg (95.9 KB) - added by birgire 16 months ago.
installed-themes.jpg (111.2 KB) - added by birgire 16 months ago.
44891.3.diff (4.0 KB) - added by birgire 16 months ago.

Download all attachments as: .zip

Change History (15)

#1 @mukesh27
16 months ago

  • Focuses administration added
  • Keywords has-screenshots needs-patch added

#2 @SergeyBiryukov
16 months ago

  • Summary changed from Active button showing after theme activeted to Activate button showing after theme activated

#3 @SergeyBiryukov
16 months ago

  • Focuses ui added

@mukesh27
16 months ago

Try this patch.

#4 @mukesh27
16 months ago

  • Keywords has-patch needs-testing added; needs-patch removed

@birgire
16 months ago

#5 @birgire
16 months 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.

Last edited 16 months ago by birgire (previous) (diff)

@birgire
16 months ago

#6 @birgire
16 months 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.isCreating.

We also have data.installed in core, then should we use data.activated instead of data.active?

Last edited 16 months ago by birgire (previous) (diff)

#7 @mukesh27
16 months ago

@birgire +1 your thought

This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.


16 months ago

Note: See TracTickets for help on using tickets.