WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Domain Mapping
Plugins urls broken with different wp-content dir (8 posts)

  1. natostanco
    Member
    Posted 10 months ago #

    following this...
    http://wordpress.org/support/topic/wordpress-mu-domain-mapping-and-mu-plugins-wrong-urls?replies=3

    I had to specify the PLUGINDIR constant into wp-config because the urls were construct from each plugin own directory resulting in http://mysite.com/style.css instead of http://mysite.com/custom/plugins/path/style.css

    So the use of the function to construct plugins url would be better :/

    http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 10 months ago #

    Thanks, someone else had already reported that so it's on the list to fix.

  3. EgyptUrnash
    Member
    Posted 9 months ago #

    I think this is what I just fixed. Spent like a half hour sprinkling echos throughout the plugin and WordPress. Making domain_mapping_plugins_uri check that the replacement it wanted to perform was actually possible did the trick for me:

    function domain_mapping_plugins_uri( $full_url, $path=NULL, $plugin=NULL ) {
    	if (stripos( $full_url, PLUGINDIR ) == FALSE)
    		return get_option( 'siteurl' ) . $full_url;
    	return get_option( 'siteurl' ) . substr( $full_url, stripos( $full_url, PLUGINDIR ) - 1 );
    }
  4. Topher
    Member
    Posted 9 months ago #

    We had this same issue and resolved it by moving the plugin to mu-plugins and calling the domain mapping file properly.

    <?php
    require('wordpress-mu-domain-mapping/domain_mapping.php');
    ?>

    in /mu-plugins/wordpress-mu-domain-mapping.php

    Magically delicious.

  5. Pablo @ vDevices
    Member
    Posted 9 months ago #

    Does anyone have an opinion on the best/easiest way of addressing the plugins directory issue?

    In my WPMU subdirectory install, when I--as Super Admin--upload a new plugin, the zip file ends up in /wp-content/uploads/2013/06 (instead of /wp-content/plugins/).

  6. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 9 months ago #

    @Pablo - you're not supposed to upload it you are supposed to install it through the network -> plugins screen.

  7. ClaytonL
    Member
    Posted 9 months ago #

    Thanks for the fix Egypt. Worked for us.

  8. ClaytonL
    Member
    Posted 9 months ago #

    Since this plugin is no longer in the mu-plugins folder, are some plugins running before the 'plugins-url' filter is added?

Reply

You must log in to post.