Clarify the inline documentation for `plugins_url()` to reflect that it also works with mu-plugins.

Props ericlewis.
See #28499.

Built from https://develop.svn.wordpress.org/trunk@28977


git-svn-id: http://core.svn.wordpress.org/trunk@28766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes 2014-07-03 19:42:15 +00:00
parent d4dd02b4ae
commit 6623df8b1f
1 changed files with 10 additions and 6 deletions

View File

@ -2626,16 +2626,20 @@ function content_url($path = '') {
} }
/** /**
* Retrieve the url to the plugins directory or to a specific file within that directory. * Retrieve a URL within the plugins or mu-plugins directory.
* You can hardcode the plugin slug in $path or pass __FILE__ as a second argument to get the correct folder name. *
* Defaults to the plugins directory URL if no arguments are supplied.
* *
* @since 2.6.0 * @since 2.6.0
* *
* @param string $path Optional. Path relative to the plugins url. * @param string $path Optional. Extra path appended to the end of the URL, including
* @param string $plugin Optional. The plugin file that you want to be relative to - i.e. pass in __FILE__ * the relative directory if $plugin is supplied. Default empty.
* @return string Plugins url link with optional path appended. * @param string $plugin Optional. A full path to a file inside a plugin or mu-plugin.
* The URL will be relative to its directory. Default empty.
* Typically this is done by passing `__FILE__` as the argument.
* @return string Plugins URL link with optional paths appended.
*/ */
function plugins_url($path = '', $plugin = '') { function plugins_url( $path = '', $plugin = '' ) {
$path = str_replace( '\\' ,'/', $path ); // sanitize for Win32 installs $path = str_replace( '\\' ,'/', $path ); // sanitize for Win32 installs
$path = preg_replace( '|/+|', '/', $path ); $path = preg_replace( '|/+|', '/', $path );