Skip to content

Instantly share code, notes, and snippets.

@fovoc
Forked from johnmontfx/gist:2be28f980f40e124fd54
Last active August 29, 2015 14:13
Show Gist options
  • Save fovoc/40a8faba8a6803601243 to your computer and use it in GitHub Desktop.
Save fovoc/40a8faba8a6803601243 to your computer and use it in GitHub Desktop.
if ( strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN' ) {
// Windows
$content_dir = str_replace( '/', DIRECTORY_SEPARATOR, WP_CONTENT_DIR );
$content_url = str_replace( $content_dir, WP_CONTENT_URL, dirname(__FILE__) );
$content_url = str_replace( $content_dir, content_url(), dirname(__FILE__) );
$cmb_url = str_replace( DIRECTORY_SEPARATOR, '/', $content_url );
} else {
$cmb_url = str_replace(
array(WP_CONTENT_DIR, WP_PLUGIN_DIR),
array(WP_CONTENT_URL, WP_PLUGIN_URL),
array( content_url() , plugins_url() ),
dirname( __FILE__ )
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment