mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Coding Standards: Check if the _deprecated_file() function exists in wp-db.php.
This avoids a fatal error if the file is included directly outside of WordPress core, e.g. by HyperDB. Additionally, replace `WPINC` with `wp-includes`, as the constant may not be defined yet in that context. Follow-up to [53749], [53750]. See #56268, #55647. git-svn-id: https://develop.svn.wordpress.org/trunk@53755 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -8,7 +8,10 @@
|
||||
* @package WordPress
|
||||
*/
|
||||
|
||||
_deprecated_file( basename( __FILE__ ), '6.1.0', WPINC . '/class-wpdb.php' );
|
||||
if ( function_exists( '_deprecated_file' ) ) {
|
||||
// Note: WPINC may not be defined yet, so 'wp-includes' is used here.
|
||||
_deprecated_file( basename( __FILE__ ), '6.1.0', 'wp-includes/class-wpdb.php' );
|
||||
}
|
||||
|
||||
/** wpdb class */
|
||||
require_once ABSPATH . WPINC . '/class-wpdb.php';
|
||||
require_once ABSPATH . 'wp-includes/class-wpdb.php';
|
||||
|
||||
Reference in New Issue
Block a user