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 5.7.1

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

From tag: Link (URL)

More from category: Plugins, Hooks

No comments
    Log In