[wp-trac] [WordPress Trac] #55560: Remove unused 'data' property from the Ajax response when adding a new term

WordPress Trac noreply at wordpress.org
Tue Apr 12 00:32:45 UTC 2022


#55560: Remove unused 'data' property from the Ajax response when adding a new term
----------------------------+---------------------
 Reporter:  SergeyBiryukov  |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  6.0
Component:  Administration  |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:
----------------------------+---------------------
Description changed by SergeyBiryukov:

Old description:

> 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], 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.

New description:

 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.

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55560#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list