WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Social Media Widget] [SOLVED] Load CSS/Images from mapped domain

[Resolved] [Plugin: Social Media Widget] [SOLVED] Load CSS/Images from mapped domain

  • When running multisite with mapped domains, the plugin content loads from the unmapped domain. This can cause problems with cacheing. I modified the plugin as follows to change this behaviour:

    //if ( !defined('WP_CONTENT_URL') ) {
    	define('SMW_PLUGINPATH',get_option('siteurl').'/wp-content/plugins/'.plugin_basename(dirname(__FILE__)).'/');
    	define('SMW_PLUGINDIR', ABSPATH.'/wp-content/plugins/'.plugin_basename(dirname(__FILE__)).'/');
    /*} else {
    	define('SMW_PLUGINPATH',WP_CONTENT_URL.'/plugins/'.plugin_basename(dirname(__FILE__)).'/');
    	define('SMW_PLUGINDIR',WP_CONTENT_DIR.'/plugins/'.plugin_basename(dirname(__FILE__)).'/');
    }*/

    http://wordpress.org/extend/plugins/social-media-widget/

Viewing 1 replies (of 1 total)
  • You could easily resolve this by defining your WP_CONTENT_URL for each site. Maybe in your functions.php file for the site theme, since that loads before the widget.

    You are essentially telling it to always load as if the WP_CONTENT_URL is defined when it’s not, which can cause a lot of issues on many other types of setups. That if statement wasn’t even in there when I first started, but a lot of people didn’t have it properly defined, so the widget would break without it.

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] [Plugin: Social Media Widget] [SOLVED] Load CSS/Images from mapped domain’ is closed to new replies.