[wp-trac] [WordPress Trac] #32845: Introduce wp_include()

WordPress Trac noreply at wordpress.org
Tue Jun 30 22:16:45 UTC 2015

#32845: Introduce wp_include()
 Reporter:  johnjamesjacoby  |       Owner:
     Type:  feature request  |      Status:  reopened
 Priority:  normal           |   Milestone:
Component:  Plugins          |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:

Comment (by johnjamesjacoby):

 Replying to [comment:4 Otto42]:
 > Minor problem: If you include/require from within a function, then the
 content of the included file is not in the global context anymore, but in
 the function context instead. I feel that this will break quite a lot of
 It will break some things, which IMO are issues with WordPress's
 application design that should be addressed anyhow.

 We could extract $GLOBALS if we feel it is a huge deal, but that's yet
 another monkey-patch approach that this is trying to give developers the
 chance to avoid.

 We can also cherry-pick the files that don't invoke anything in the global
 scope, where as files like `wp-login.php`have obvious issues.

Ticket URL: <https://core.trac.wordpress.org/ticket/32845#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list