Title: Support for mu-plugins folder, when using plugins_url()
Last modified: August 30, 2016

---

# Support for mu-plugins folder, when using plugins_url()

 *  [Scott Kingsley Clark](https://wordpress.org/support/users/sc0ttkclark/)
 * (@sc0ttkclark)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/support-for-mu-plugins-folder-when-using-plugins_url/)
 * plugins_url() is supposed to work for plugins or mu-plugins, the code inside 
   it supports both. But the filter inside this plugin forces one, and if it’s an
   mu-plugin, it breaks all of the URLs.
 * Problem code in the plugin itself stems from this:
 * `add_filter( 'plugins_url', 'domain_mapping_plugins_uri', 1 );`
 * which calls:
 *     ```
       function domain_mapping_plugins_uri( $full_url, $path=NULL, $plugin=NULL ) {
       	return get_option( 'siteurl' ) . substr( $full_url, stripos( $full_url, PLUGINDIR ) - 1 );
       }
       ```
   
 * I think this would be better, but I’m not sure if this plugin will get future
   updates:
 *     ```
       function domain_mapping_plugins_uri( $full_url, $path=NULL, $plugin=NULL ) {
   
       	$siteurl = get_site_url();
   
       	if ( false !== stripos( $full_url, PLUGINDIR ) ) {
       		$full_url = $siteurl . substr( $full_url, stripos( $full_url, PLUGINDIR ) - 1 );
       	} elseif ( false !== stripos( $full_url, MUPLUGINDIR ) ) {
       		$full_url = $siteurl . substr( $full_url, stripos( $full_url, MUPLUGINDIR ) - 1 );
       	}
   
       	return $full_url;
   
       }
       ```
   
 * The code above is backwards compatible with WP 3.0+
    - PLUGINDIR was added in 2.1
    - MUPLUGINDIR was added in 2.8
    - get_site_url() was added in 3.0
 * Given that the plugin states support for 3.1+, this should be acceptable. Even
   though the two constants referenced here are deprecated, it at least resolves
   the issues using the plugin presents for those using mu-plugins files as well.
 * [https://wordpress.org/plugins/wordpress-mu-domain-mapping/](https://wordpress.org/plugins/wordpress-mu-domain-mapping/)

The topic ‘Support for mu-plugins folder, when using plugins_url()’ is closed to
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-mu-domain-mapping.svg)
 * [WordPress MU Domain Mapping](https://wordpress.org/plugins/wordpress-mu-domain-mapping/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-mu-domain-mapping/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-mu-domain-mapping/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-mu-domain-mapping/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-mu-domain-mapping/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-mu-domain-mapping/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Scott Kingsley Clark](https://wordpress.org/support/users/sc0ttkclark/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/support-for-mu-plugins-folder-when-using-plugins_url/)
 * Status: not resolved