Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#55560 closed defect (bug) (wontfix)

Remove unused 'data' property from the Ajax response when adding a new term

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.9
Component: Administration Keywords: has-patch close
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Background: #42937, #54955, #55078.

As part of the changes in [52170] and [52672], a data property was added to the Ajax response from wp_ajax_add_tag() to display a success notice when adding a new term on taxonomy screens. In [53123], the notice was moved to the supplemental->notice property. However, data remained due to a failing test and potential backward compatibility concerns.

Given that 'data' => $message was only added to the response five months ago in [52170], was never documented anywhere, and never used for anything else, I think removing it should not affect backward compatibility. Leaving it unused and duplicated, on the other hand, might cause confusion later.

Attached is a patch from #55078 that removes the property and updates the associated unit test to pass as expected. This will need a refresh once the latest patch on #55078 is committed.

Attachments (1)

55560.2.diff (916 bytes) - added by SergeyBiryukov 3 years ago.

Download all attachments as: .zip

Change History (6)

#1 @SergeyBiryukov
3 years ago

  • Description modified (diff)

#2 @peterwilsoncc
3 years ago

  • Keywords close added

I don't think it wise to remove these.

A goal of WP is to maintain backward compatibility, removing something that's only been around for a release is still a backward compatibility break. For the REST API there's the v2 space, unfortunately that's not available for admin-ajax action.

If anything, I think adding something in one release only to remove it in the next is a bigger breach of the stated goal than it is to remove something that's proven to be unused.

#3 @costdev
3 years ago

  • Version set to 5.9

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


3 years ago

#5 @costdev
3 years ago

  • Milestone 6.0 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I agree with @peterwilsoncc's comment. While this was only added in the last major release, changing it is still a BC break.

I'm going to close this ticket as wontfix. If discussion continues, feel free to reopen this ticket on the 6.1 or Future Release milestone.

Note: See TracTickets for help on using tickets.