WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#37598 closed defect (bug) (fixed)

Fix plugin/theme delete/install success hook inconsistency

Reported by: olarmarius Owned by: jorbin
Milestone: 4.6 Priority: normal
Severity: normal Version: 4.6
Component: Themes Keywords: has-patch commit
Focuses: javascript, administration Cc:
PR Number:

Description

The delete hook name for plugin deletion is "wp-plugin-delete-success" and for theme "wp-delete-theme-success". We need to resolve this inconsistency.

A) wp-delete-plugin-success & wp-delete-theme-success
B) wp-plugin-delete-success & wp-theme-delete-success

wp-plugin-delete-success
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/js/updates.js?rev=38199&marks=821&1246#L819

wp-delete-theme-success
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/js/updates.js?rev=38199&marks=821&1246#L1246

Attachments (4)

updates.js.37598.diff (467 bytes) - added by olarmarius 3 years ago.
37598.patch (1.0 KB) - added by ocean90 3 years ago.
37598-install.patch (1.4 KB) - added by olarmarius 3 years ago.
Also the patch for install hook bug
37598.2.patch (1.9 KB) - added by ocean90 3 years ago.

Download all attachments as: .zip

Change History (14)

#1 @SergeyBiryukov
3 years ago

  • Milestone changed from Awaiting Review to 4.6

Introduced in [37714].

@ocean90
3 years ago

#2 follow-up: @ocean90
3 years ago

  • Component changed from Administration to Themes
  • Keywords has-patch added

It should be B), see 37598.patch.

Last edited 3 years ago by ocean90 (previous) (diff)

#3 in reply to: ↑ 2 ; follow-up: @olarmarius
3 years ago

#4 in reply to: ↑ 3 @ocean90
3 years ago

Replying to olarmarius:

But it's A

Sorry, meant B.

@olarmarius
3 years ago

Also the patch for install hook bug

@ocean90
3 years ago

#5 @ocean90
3 years ago

  • Keywords commit added
  • Summary changed from Fix plugin/theme delete success hook inconsistency to Fix plugin/theme delete/install success hook inconsistency

As pointed out by @olarmarius, the install actions are also inconsistent.

37598.2.patch combines 37598-install.patch and 37598.patch.

Related: #37512, #37216

This ticket was mentioned in Slack in #feature-shinyupdates by ocean90. View the logs.


3 years ago

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


3 years ago

#8 @ocean90
3 years ago

  • Owner set to jorbin
  • Status changed from new to reviewing

#9 @jorbin
3 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 38218:

Updates: Standardize JS Custom Event Names

Custom JS events are triggered on the document in order for plugins to have something to hook into. The standard began in #31819 is dash separated and begins with wp to signify the namespace, followed by the subject of our action ( "theme", "plugin", etc.) followed by the action and an optional indicator of status ( "install-success", "deleting" ).

This brings some of the theme hooks in line with the standard. As of now, all plugin actions in src/wp-admin/js/updates.js have an equal corresponding theme action.

Fixes #37598.
See #37512, #37216, #31819.
Props olarmarius, ocean90.

#10 @jorbin
3 years ago

In 38219:

Updates: Standardize JS Custom Event Names

Merges [38218] in to 4.6 branch.

Custom JS events are triggered on the document in order for plugins to have something to hook into. The standard began in #31819 is dash separated and begins with wp to signify the namespace, followed by the subject of our action ( "theme", "plugin", etc.) followed by the action and an optional indicator of status ( "install-success", "deleting" ).

This brings some of the theme hooks in line with the standard. As of now, all plugin actions in src/wp-admin/js/updates.js have an equal corresponding theme action.

Fixes #37598.
See #37512, #37216, #31819.
Props olarmarius, ocean90.

Note: See TracTickets for help on using tickets.