#38838 closed defect (bug) (wontfix)
Needed functionality/modification
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Bootstrap/Load | Keywords: | |
Focuses: | Cc: |
Description
I think its a good suggestion for future development of WORDPRESS, because I have managed to migrate to Wordpress as my framework for all my global projects...
I have developed a theme (actually plugin, but lets say about themes).. where I have integrated all my custom PURE PHP fucntions & favorite libraries into theme's function.php
file.
However, in functions.php
there I have also added many add_action/add_filter
and etc, that i use with Wordpress..
So, One day, I managed to put in the beginning of WP_CONFIG.PHP:
require_once(.............../functions.php)
As I mentioned above, there are times, when I dont want to load WP-CORE framework, just want to fire my CUSTOM functions at first (before WP-loads... grabbing ID from REQUEST_URL, checking specific cookies, validating IPs, and etc..).
I do this, because i dont want to use those functions within WP hooks (as thousands of users might non-efectively cause WP-CORE loading, as it is not needed at all - my mentioned functions are just pure PHP functions)
The only problem raised there, was that
add_action/add_filter
is not defined functions(At this moment, I dont need them at all).... no problem. I have added this :
include_once(ABSPATH.'wp-includes/plugin.php
)`
however, when real WP-CORE loads, the function is defined already and causes problems...
I wanted to suggest, to invent some solution and add this code (into the start of CORE add_action/add_filter/remove_action...
functions )
function add_filter(.....){ if(!defined('ANY_CONSTANT_THAT_CONFIRMS_THE_DEFAULT_LOAD_OF_WP')) return; else ... go on the current functions... }
I dont know If i have expressed correctly what I wanted, however, you might understand guys..
thanks..
please respond..
Change History (5)
#1
in reply to:
↑ description
;
follow-up:
↓ 2
@
8 years ago
- Component changed from General to Bootstrap/Load
#3
@
8 years ago
temporary solution I use to avoid "Re-declare function" errors - http://stackoverflow.com/q/530649/2377343
#4
@
8 years ago
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
Unfortunately at this time we're not interested in adding such functionality to WordPress, and while loading WordPress on a modern version of PHP is still much slower than a stand alone PHP script, it's not as bad as many people feel it is (performance wise).
There's plenty of scenario's you probably haven't thought about which would affect WordPress implementing something like this - how do we deal with Authentication? How do we deal with plugins being able to affect the output? etc.
If you honestly truly want to call a static PHP file, you can do so - just know that themes which do that are not hosted in the WordPress.org theme directory, and we advise strongly against doing so.
Replying to tazotodua:
There's a
SHORTINIT
constant you could use for that: http://wpengineer.com/2449/load-minimum-of-wordpress/