If you read the wiki section Michael linked to, you’ll see that it is far preferable to use str_replace
vs overriding the URL directly. If you read that section, it will explain why.
function update_cmb2_meta_box_url( $url ) {
/*
* If you use a symlink, the css/js urls may have an odd path stuck in the middle, like:
* https://SITEURL/wp-content/plugins/Users/jt/Sites/CMB2/cmb2/js/cmb2.js?ver=X.X.X
* Or something like that.
*
* INSTEAD of completely replacing the URL,
* It is best to do a str_replace. This ensures you only change the url if it's
* pointing to the broken resource. This ensures that if another version of CMB2
* is loaded (i.e. in a 3rd part plugin), that their correct URL will load,
* rather than forcing yours.
*/
return str_replace( 'C:/Ampps/www/hypenews/wp-content/', 'wp-content/', $url );
}
add_filter( 'cmb2_meta_box_url', 'update_cmb2_meta_box_url' );