forked from liggitt/wordpress-plugin-symlink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin-symlink.php
22 lines (20 loc) · 1.2 KB
/
plugin-symlink.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
/*
Plugin Name: Plugin Symlink
Plugin URI: http://github.com/liggitt/wordpress-plugin-symlink
Description: Allows a symlinked folder to be used as the plugins folder. Install in a subdirectory ending with 'plugin-symlink', so the path can be detected correctly.
Version: 1.1
Author: Jordan Liggitt
Author URI: http://jordan.liggitt.net
License: GPL2
*/
function liggitt_filter_plugins_url($url) {
$path = dirname(__FILE__);
$basename = basename($path);
if (preg_match('/plugin-symlink$/', $basename)) {
$path = dirname($path);
}
$newurl = str_replace($path, "", $url);
return $newurl;
}
add_filter('plugins_url', liggitt_filter_plugins_url);