[wp-trac] [WordPress Trac] #33413: most PHP classes should be in their own file
WordPress Trac
noreply at wordpress.org
Wed Sep 9 09:39:21 UTC 2015
#33413: most PHP classes should be in their own file
----------------------------+-----------------------------
Reporter: wonderboymusic | Owner: wonderboymusic
Type: enhancement | Status: assigned
Priority: normal | Milestone: 4.4
Component: General | Version: trunk
Severity: normal | Resolution:
Keywords: dev-feedback | Focuses:
----------------------------+-----------------------------
Comment (by DrewAPicture):
Replying to [comment:59 westonruter]:
> If you search GitHub across all repos, you'll see many examples of this
(though many are just clones of Core): https://github.com/search?l=php&q
=class-wp-customize-manager.php&type=Code
>
> I suppose it is acceptable to break plugin unit tests with this re-
organization if this is all that breaks… but, loading other class files is
not limited to unit tests. I see [https://github.com/search?l=php&q=class-
wp-customize-control.php&ref=searchresults&type=Code&utf8=%E2%9C%93
examples] of directly loading the control class file `require_once(
ABSPATH . WPINC . '/class-wp-customize-control.php' )`:
>
> *
https://github.com/nathancorbier/condemnationlaw/blob/631af9ba9a9cf9b2b09c58e3c9ead930081b55a4
/wp-content/themes/stacy/includes/class-fonts-customizer.php#L2
> * https://github.com/xwp/wp-settings-
revisions/blob/231ba0ff2991d15980c9ec34c180f20b26dea489/php/meta-
control.php#L3
> * https://github.com/engrnvd/Wordpress-
Sandbox/blob/ac31a58db97df411b3dc3b698ad80379907bb93b/wp-content/themes
/dw-fixel/inc/class-customization.php#L2
>
> These plugins would all break.
What if we introduced the new file and loaded it from the old one for
back-compat, meanwhile tossing a `_deprecated_file()` notice, then delete
the old file a few releases down the road, giving time for devs to update?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33413#comment:60>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list