presuming that i am writing a wordpress wordpress plugin. now i would like its includes and can include includes to become in accordance with the wordpress directory so now you ask , there a worldwide variable/constant or perhaps a function to retreive this data ?

Yes that you can do ABSPATH example: require_once(ABSPATH . 'wp-settings.php'); This provides you with the complete road to your WordPress Installation.

There is the get_bloginfo function which may be used to retrieve the entire URL for the WordPress install, your site and/or perhaps your theme directory.

To obtain your plugin's directory, have a look in the plugin_basename function.

It is necessary if you're writing a wordpress plugin for public distribution, that you simply make certain that you don't hard code the pathways. This is among the greatest problems wordpress plugin developer's cause, because customers be capable of move these folders around.

The fundamental method of getting Web addresses towards the website is: get_bloginfo('url') <- would go to sites root get_bloginfo('wpurl') <- would go to wordpress' root which may be two various things. So this is an excellent method of getting towards the wordpress directory.

You will find also defined variables: Wordpress_Wordpress plugin_URL Wordpress_Wordpress plugin_DIR

A means recommended within the codex to obtain to your plugin's folder for includes is:

WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__));

Should output: http://[url-path-to-plug ins]/[myplugin]/

Wherever the consumer places their plug ins folder.