Skip to content

Instantly share code, notes, and snippets.

@scottnath
Created January 4, 2012 17:59
Show Gist options
  • Save scottnath/1561223 to your computer and use it in GitHub Desktop.
Save scottnath/1561223 to your computer and use it in GitHub Desktop.
function nbcu_plugins_url
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