WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/23/2009 08:16:06 AM (13 years ago)
Author:
azaozz
Message:

Make plugin_dir() and plugin_basename() work for mu-plugins directory, props Denis-de-Bernardy, fixes #9561

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r11062 r11069  
    17761776function plugins_url($path = '', $plugin = '') {
    17771777    $scheme = ( is_ssl() ? 'https' : 'http' );
    1778     $url = WP_PLUGIN_URL;
     1778
     1779    if ( $plugin !== '' && preg_match('#^' . preg_quote(WPMU_PLUGIN_DIR . DIRECTORY_SEPARATOR, '#') . '#', $plugin) ) {
     1780        $url = WPMU_PLUGIN_URL;
     1781    } else {
     1782        $url = WP_PLUGIN_URL;
     1783    }
     1784
    17791785    if ( 0 === strpos($url, 'http') ) {
    17801786        if ( is_ssl() )
     
    17821788    }
    17831789
    1784     if ( !empty($plugin) && is_string($plugin) )
    1785     {
     1790    if ( !empty($plugin) && is_string($plugin) ) {
    17861791        $folder = dirname(plugin_basename($plugin));
    17871792        if ('.' != $folder)
Note: See TracChangeset for help on using the changeset viewer.