jaredatch/Custom-Metaboxes-and-Fields-for-WordPress — Issue #31: Problem with CMB_META_BOX_URL creation method
Author: smeric
Created: 2011-10-13 00:30:53+00:00
State: open

hi,

i went into an issue withe the CMB_META_BOX_URL constant creation method.
i'm working localy on wamp with wp3.2.1

this is what i've got :

echo WP_CONTENT_DIR;
C:\Program Files (x86)\EasyPHP-5.3.6.0\www\wordpress\wordpress3.2.1__/wp-content__

as you can see, the WP_CONTENT_DIR constant has a slash before the last directory instead of a back slash.
i don't know why, so maybe that comes from me and my easyphp install, or from windows... if you think so, please tell me.

so i had to replace your :

define( 'CMB_META_BOX_URL', trailingslashit( str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, dirname(__FILE__) ) ) );

with this one :

define( 'CMB_META_BOX_URL', trailingslashit( str_replace( str_replace( '\\', '/', WP_CONTENT_DIR ), str_replace( '\\', '/', WP_CONTENT_URL ), str_replace( '\\', '/', dirname(__FILE__) ) ) ) );

that way i'm sure to get slashs everywhere !

not sure that is the best way to do it, so, please, let me know what you think :)

thank you for this very usefull lib ! i'm just starting tests with it, but seems promising :)

seb.