WordPress 3.5: Setting custom “full URL path to files” in the Media Library?

As the recent changes in WordPress 3.5 removed the “full URL path to files” option from media library I am wondering how to set this option to a custom path now?

I need to set my “full URL path to files” for my media files to a custom subdomain. Can you guys help me out with finding a solution for this problem?

Read More

Regards,
faxxim

Related posts

Leave a Reply

2 comments

  1. The option name is upload_url_path, and you can still filter it:

    add_filter( 'pre_option_upload_url_path', 'wpse_77960_upload_url' );
    
    function wpse_77960_upload_url()
    {
        return 'http://subdomain.example.com/files';
    }
    
  2. Thank you @Toscho for providing me with the name of the option. Here’s another way to change it, by placing this in your functions.php file:

    update_option('upload_url_path', '/wp-content/uploads');
    

    This will make WordPress embed images like src="/wp-content/uploads/file.jpg" instead of src="http://domain.com/wp-content/uploads/file.jpg"