[wp-trac] [WordPress Trac] #56268: Rename wp-db.php to class-wpdb.php

WordPress Trac noreply at wordpress.org
Thu Jul 21 15:58:01 UTC 2022


#56268: Rename wp-db.php to class-wpdb.php
------------------------------+--------------------
 Reporter:  SergeyBiryukov    |      Owner:  (none)
     Type:  enhancement       |     Status:  new
 Priority:  normal            |  Milestone:  6.1
Component:  Database          |    Version:
 Severity:  normal            |   Keywords:
  Focuses:  coding-standards  |
------------------------------+--------------------
 Background: #47632, #49373.

 `wpdb` is the only core class that is not an external library and does not
 follow the `class-*.php` naming pattern:
 {{{
 | WARNING | Class file names should be based on the class name
 |         | with "class-" prepended. Expected class-wpdb.php, but
 |         | found wp-db.php.
 |         | (WordPress.Files.FileName.InvalidClassFileName)
 }}}

 For consistency with the rest of core classes and to conform to
 [https://make.wordpress.org/core/handbook/best-practices/coding-
 standards/php/#naming-conventions naming conventions] in WordPress coding
 standards, the class should be moved to `wp-includes/class-wpdb.php`,
 following the process in comment:33:ticket:47632.

 For backward compatibility, the new file should be included from `wp-
 includes/wp-db.php`.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56268>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list