[wp-trac] [WordPress Trac] #38838: Needed functionality/modification

WordPress Trac noreply at wordpress.org
Thu Nov 17 11:25:22 UTC 2016


#38838: Needed functionality/modification
--------------------------+-----------------------------
 Reporter:  tazotodua     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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:

 {{{#!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..

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


More information about the wp-trac mailing list