WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Domain Mapping
Small patch for next update - media file URLs (8 posts)

  1. benallfree
    Member
    Posted 1 year ago #

    Hello,

    Here is a small patch to make media file URLs mapped:

    add_filter( 'wp_get_attachment_url', 'domain_mapping_post_content' );

    If you go into Media > Edit, you will see the File URL off to the side. Without this filter, the FIle URL shows the original multisite path.

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

  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    Thanks I'll put that on my list.

  3. George Appiah
    Member
    Posted 1 year ago #

    Thanks for the quick fix. My users were up in arms with me :-)

  4. Pablo @ vDevices
    Member
    Posted 1 year ago #

    @benallfree,

    Where does your patch go? On the last line of /wp-content/plugins/wordpress-mu-domain-mapping/domain_mapping.php?

    Thanks!

  5. George Appiah
    Member
    Posted 1 year ago #

    In your theme's functions.php file

  6. benallfree
    Member
    Posted 1 year ago #

    George is right, it can go anywhere, or if you wish, even as a new plugin:

    <?php
    /*
    Plugin Name: MU Domain Mapping File URL Patch
    */
    add_filter( 'wp_get_attachment_url', 'domain_mapping_post_content' );

  7. Pablo @ vDevices
    Member
    Posted 1 year ago #

    Thanks @George & @benallfree!

    I went ahead and turned the patch into a new plugin and dropped it in the mu-plugins folder.

  8. aikitect
    Member
    Posted 1 year ago #

    This is super helpful. Thanks guys!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic