[wp-trac] [WordPress Trac] #26818: When plugins are loaded check for a class of the same name and autoload if exists

WordPress Trac noreply at wordpress.org
Sun Jan 12 18:47:17 UTC 2014


#26818: When plugins are loaded check for a class of the same name and autoload if
exists
-------------------------+-----------------------------
 Reporter:  dwread       |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:
 Severity:  normal       |   Keywords:
-------------------------+-----------------------------
 Had a good search but couldn't find any similar tickets, so sorry if I
 missed it.

 When WordPress loads & includes plugins I think it would make sense / be a
 handy feature if once the plugin file was included it then tried to load a
 class of the same name. This would be a great step towards autoloading,
 help push towards more OOP plugins in the future and pave the way towards
 namespacing then we hit PHP 5.3.

 Obviously it shouldn't be hard to do, a simple if( class_exists() ) etc.
 Happy to work up a patch if people agree.

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


More information about the wp-trac mailing list