[wp-hackers] "deprecating" direct calls to wp-config.php

Olivier autremonde75 at gmail.com
Tue Nov 17 14:33:11 UTC 2009


I saw this subject so I tried to adapt my plugins but no luck so far :
I have used the example provided on the CoDex.

So I have removed the require_once wp-config.php
Then I have encapsulated all my js/jQuery ajax code into a php
function. Then I have hooked my function on admin_header and added a
require_once for the file including my ajax function into my main
plugin file but no luck, it doesn't work, the code is apparently not
hit :(

One issue I see about this change is that my ajax code will be loaded
on every admin page while right now it was loaded only for the
specific page it was intended to (thanks to the admin_print_scripts
hook) so it will be a performance degradation.

Isn't there any way to make everybody happy (ie finding a way to
properly locate the wp-config.php whatever the installation path is?).



More information about the wp-hackers mailing list