WordPress at a glance

plugin_dir_url() WP 1.0

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

Works based on: plugins_url()

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-includes/plugin.php WP 5.2.4

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

Related Functions

From tag: Link (URL)

More from category: Plugins, Hooks

No comments
    Hello, !     Log In . Register