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

    r10765 r11069  
    493493    $plugin_dir = str_replace('\\','/',WP_PLUGIN_DIR); // sanitize for Win32 installs
    494494    $plugin_dir = preg_replace('|/+|','/', $plugin_dir); // remove any duplicate slash
    495     $file = preg_replace('|^' . preg_quote($plugin_dir, '|') . '/|','',$file); // get relative path from plugins dir
     495    $mu_plugin_dir = str_replace('\\','/',WPMU_PLUGIN_DIR); // sanitize for Win32 installs
     496    $mu_plugin_dir = preg_replace('|/+|','/', $mu_plugin_dir); // remove any duplicate slash
     497    $file = preg_replace('#^' . preg_quote($plugin_dir, '#') . '|^' . preg_quote($mu_plugin_dir, '#') . '/#','',$file); // get relative path from plugins dir
    496498    return $file;
    497499}
Note: See TracChangeset for help on using the changeset viewer.