Created
January 4, 2012 17:59
-
-
Save scottnath/1561223 to your computer and use it in GitHub Desktop.
function nbcu_plugins_url
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function nbcu_plugins_url( $url = '', $path = '', $plugin = '' ) { | |
$nbcu_url = '/nbcu-plugins/'; | |
$plugin_base_name = basename( dirname( $plugin )); | |
$plugin_dir_path = rtrim(str_replace( basename( dirname( $plugin ) ), '', dirname( $plugin ) ), '/'); | |
if($plugin_dir_path != WP_PLUGIN_DIR){ | |
$url = WP_PLUGIN_URL.$nbcu_url.$plugin_base_name; | |
} | |
return $url; | |
} | |
add_filter( 'plugins_url', 'nbcu_plugins_url', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment