From 6623df8b1fc2afe4d6c3ce15b37e74f4ab8eb233 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Thu, 3 Jul 2014 19:42:15 +0000 Subject: [PATCH] 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 --- wp-includes/link-template.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 557e753877..9763c81523 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -2626,16 +2626,20 @@ function content_url($path = '') { } /** - * Retrieve the url to the plugins directory or to a specific file within that directory. - * You can hardcode the plugin slug in $path or pass __FILE__ as a second argument to get the correct folder name. + * Retrieve a URL within the plugins or mu-plugins directory. + * + * Defaults to the plugins directory URL if no arguments are supplied. * * @since 2.6.0 * - * @param string $path Optional. Path relative to the plugins url. - * @param string $plugin Optional. The plugin file that you want to be relative to - i.e. pass in __FILE__ - * @return string Plugins url link with optional path appended. + * @param string $path Optional. Extra path appended to the end of the URL, including + * the relative directory if $plugin is supplied. Default empty. + * @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 = preg_replace( '|/+|', '/', $path );