WordPress.org

Make WordPress Core

Ticket #13550: plugin_basename.patch

File plugin_basename.patch, 556 bytes (added by vladimir_kolesnikov, 8 years ago)

Adds a call to a filter to override plugin_basename()'s result

  • wp-includes/plugin.php

     
    555555        $mu_plugin_dir = preg_replace('|/+|','/', $mu_plugin_dir); // remove any duplicate slash
    556556        $file = preg_replace('#^' . preg_quote($plugin_dir, '#') . '/|^' . preg_quote($mu_plugin_dir, '#') . '/#','',$file); // get relative path from plugins dir
    557557        $file = trim($file, '/');
    558         return $file;
     558        return apply_filters('plugin_basename', $file);
    559559}
    560560
    561561/**