[wp-trac] [WordPress Trac] #65045: Duplicate 'Comment' entry in trashableTypes array in wp/api.js
WordPress Trac
noreply at wordpress.org
Wed Apr 15 07:22:12 UTC 2026
#65045: Duplicate 'Comment' entry in trashableTypes array in wp/api.js
-------------------------+-------------------------------------------------
Reporter: | Owner: (none)
baikare.sandeep007 |
Type: defect | Status: new
(bug) |
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch | Focuses: javascript, rest-api, coding-
| standards
-------------------------+-------------------------------------------------
Comment (by darshitrajyaguru97):
== Patch Tested ==
https://core.trac.wordpress.org/attachment/ticket/65045/trashable-types-
fix.2.patch
=== **Testing Summary ===
I tested the updated patch and can confirm that it correctly removes the
duplicate 'Comment' entry from the `trashableTypes` array in
`src/js/_enqueues/wp/api.js`.
=== **Steps Performed ===
# Located the `trashableTypes` array in `wp/api.js` and verified the
duplicate 'Comment' entry in the original code.
# Applied the `trashable-types-fix.2.patch`.
# Confirmed that the duplicate 'Comment' entry was removed and the array
now contains only unique values.
# Tested the following actions in the WordPress admin:
# Trash comment
# Restore comment
# Permanently delete comment
# Checked the browser console for JavaScript errors.
=== **Results ===
* ✅ Duplicate entry successfully removed
* ✅ No JavaScript errors observed
* ✅ No regression in functionality
* ✅ Trash-related operations for comments and other post types work as
expected
=== **Environment ===
* WordPress: 7.0 RC2
* PHP: 8.3.30
* Browser: Chrome
* OS: Windows
=== **Conclusion ===
The patch works as expected.
This change improves code clarity by removing redundant data without
affecting functionality.
'''Recommendation:''' Patch is good to commit ✅
--
Ticket URL: <https://core.trac.wordpress.org/ticket/65045#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list