Opened 3 years ago
Last modified 3 years ago
#55115 new enhancement
Change deprecated wpdb::escape() method
Reported by: | azouamauriac | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Database | Keywords: | close 2nd-opinion |
Focuses: | Cc: |
Description
the function wpdb::escape( string|array $data ) is depreciate as per documentation https://developer.wordpress.org/reference/classes/wpdb/escape/, but it's still using depreciated function such as wpdb::_weak_escape and itself.
I think we shouldn't use depreciated functions since charity begins at home.
Change History (5)
#3
@
3 years ago
- Keywords close 2nd-opinion added
Hi there, welcome back to WordPress Trac! Thanks for the ticket.
WordPress generally does not remove deprecated functions, to maintain backward compatibility and avoid unnecessary breakage, but instead recommends a better way forward.
In this case, the function is no longer used in core as of [24718] / #24774, so it does not look like there's anything for core to address. As for modernizing the deprecated method itself, I don't think it's worth the effort, because it might introduce unintended side effects without a significant benefit.
Function deprecated since version 3.6.0 but still in core?
Shouldn't be removed after for example two major releases (in this case in 5.6) for code cleanup?