Open markkevans opened 11 years ago
When uploading images this plugin writes uploaded content to
define('SAM_AD_IMG', WP_PLUGIN_DIR.'/sam-images/'); define('SAM_AD_URL', plugins_url('/sam-images/'));
I think this should actually go into WP_CONTENT_DIR as in reality its not part of the plugin but is content which the plugin manages.
I'm happy to offer a patch for this and I can think of 2 different solutions so wanted to get your feedback.
define('SAM_AD_IMG', WP_CONTENT_DIR.'/sam-images/'); define('SAM_AD_URL', content_url('/sam-images/'));
This will break backwards compatibility with existing users however
if ( !defined( 'SAM_AD_IMG' ) ) define('SAM_AD_IMG', WP_PLUGIN_DIR.'/sam-images/');
if ( !defined( 'SAM_AD_URL' ) ) define('SAM_AD_URL', plugins_url('/sam-images/'));
This would allow users to override the content location using wp-config but will make the code slighly less maintainable
If you could provide some feedback on this I would be most grateful
When uploading images this plugin writes uploaded content to
define('SAM_AD_IMG', WP_PLUGIN_DIR.'/sam-images/'); define('SAM_AD_URL', plugins_url('/sam-images/'));
I think this should actually go into WP_CONTENT_DIR as in reality its not part of the plugin but is content which the plugin manages.
I'm happy to offer a patch for this and I can think of 2 different solutions so wanted to get your feedback.
define('SAM_AD_IMG', WP_CONTENT_DIR.'/sam-images/'); define('SAM_AD_URL', content_url('/sam-images/'));
This will break backwards compatibility with existing users however
if ( !defined( 'SAM_AD_IMG' ) ) define('SAM_AD_IMG', WP_PLUGIN_DIR.'/sam-images/');
if ( !defined( 'SAM_AD_URL' ) ) define('SAM_AD_URL', plugins_url('/sam-images/'));
This would allow users to override the content location using wp-config but will make the code slighly less maintainable
If you could provide some feedback on this I would be most grateful