I submitted the plugon and received the following email back from WordPress:
Including wp-config.php, wp-blog-header.php, wp-load.php, or pretty much any other WordPress core file that you have to call directly via an include is not a good idea and we cannot approve a plugin that does so unless it has a very good reason to load the file(s). It is prone to failure since not all WordPress installs have the exact same file structure.
Usually plugins will include wp-config.php or wp-load.php in order to gain access to core WordPress functions, but there are much better ways to do this.
It’s best if you tie your processing functions (the ones that need but don’t have access to core functions) into an action hook, such as “init” or “admin_init”.
Please consult the Plugins API reference for more information: http://codex.wordpress.org/Plugin_API
If you’re trying to use AJAX, please read this: http://codex.wordpress.org/AJAX_in_Plugins
When you’ve corrected your code, reply to this email with the updated code attached, or provide a link to the new code.
However, I do not use include and the only file I call is wp-load.php
The code I use to do this is:
$parse_uri = explode( ‘wp-content’, $_SERVER[‘SCRIPT_FILENAME’] );
require_once( $parse_uri . ‘wp-load.php’ );
Can anyone point me in the right direction to what I need to be using if this is not accepted.
I call that file because withput it I get a
Fatal error: Call to undefined function error
- The topic ‘Correct metgod to include wp-load.php’ is closed to new replies.