Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Relative plugin paths in some places, absolute paths in other places?

$
0
0

Replies: 0

When hooking activated_plugin (for example), the hook is called with two parameters, $plugin and $network. It looks like $plugin contains only relative path information. If I want to use the get_plugin_data() function, it wants an absolute path.

How do I obtain this absolute path, given the relative path passed to me, the WordPress way? Everywhere I look, it explicitly states that the WP_PLUGIN_DIR and WPMU_PLUGIN_DIR constants are for internal use only.

Sorry if this has already been beaten to death here and elsewhere. And, please do not suggest I pass __FILE__ to some function. I don’t want to find out the absolute path to my own code.

I’m obviously doing something wrong, and am hoping for someone to tell me what that wrong is 🙂

-joho


Viewing all articles
Browse latest Browse all 59525

Trending Articles