0

I have a small question for you. How can I dinamicaly get a plugin file path? I want to make an ajax call from a page to a file wich is in my plugins directory, and I don't want to use wp-content/ . . . . etc Is there a way to do that? So it can work on every site. Thank you

1
  • Don't do that. Wordpress says you should route AJAX calls through admin-ajax.php, and they publish the documented way to do that in the codex. codex.wordpress.org/AJAX_in_Plugins If you do not follow this advice, you will likely have problems on non-standard installations of Wordpress. Commented Jun 4, 2012 at 19:41

1 Answer 1

1

is this what you looking for:

$plugin_url =WP_PLUGIN_URL.'/'.dirname(plugin_basename (__FILE__));

this must be placed in your plugin file.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.