WordPress at Your Fingertips

plugin_dir_url() WP 1.0

Get the URL directory path (with trailing slash) for the plugin __FILE__ passed in.

No Hooks.


String. the URL path of the directory that contains the plugin.


plugin_dir_url( $file );
$file(string) (required)
The filename of the plugin (__FILE__).


Since 2.8.0 Introduced.

Code of plugin_dir_url() WP 5.8.1

function plugin_dir_url( $file ) {
	return trailingslashit( plugins_url( '', $file ) );

Link (URL)

Plugins, Hooks

No comments
    Log In