-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Requests 2.0+ namespaced interfaces when available. (#925)
## What is this PR doing? Uses the WP 6.2+ / Requests 2.0+ namespaced classes, to avoid deprecation warnings, while supporting older clients. ## What problem is it solving? Fixes #922 PHP deprecation notices, which can be seen in [Theme Directory live previews](https://themes.trac.wordpress.org/ticket/159444#:~:text=zip%3Fnostats%3D1-,Live%20preview,-%E2%80%93%20https%3A//playground) ## How is the problem addressed? Conditionally selecting the class to use ## Testing Instructions Go to http://localhost:5400/website-server/#{%22steps%22:[{%22step%22:%22defineWpConfigConsts%22,%22consts%22:{%22WP_DEBUG%22:true}}]} and confirm the following deprecation notices are not shown: ``` Deprecated: The PSR-0 'Requests_... class names in the Requests library are deprecated. Switch to the PSR-4 'WpOrg|Requests|.. class names at your ``` (Other deprecation notices are expected as they're present in WordPress core)
- Loading branch information
Showing
2 changed files
with
45 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters