You have (sort of) a solution, but it seems that I’m in the same situation that you are in. An issue that arises with your solution is that it renders the Media Library uploads unusable while uploading assets as an Admin user. The “pre_option_upload_url_path” filter is all but forgotten in WP 4.7, and though I have had support questions pending, no one has come forward to attempt a solution.
I hacked the /wp-includes/functions.php file and replaced the entire “wp_upload_dir” function with the older WP version and it is now working. (1875 to 1919 in WP4.7)
Yes … this is a hack, but I can now use the following code in my theme’s functions.php file:
function cdn_upload_url() {
if ( ! is_admin() ) {
return 'https://d24fxnpb2c5viy.cloudfront.net';
}
}
add_filter( 'pre_option_upload_url_path', 'cdn_upload_url' , 10);
If you do this, remember to delete the “upload_url_path” entry from your database.
Hopefully we will be recognized as legitimate on the support group at some point.
-
This reply was modified 7 years, 10 months ago by jamiedusa.
-
This reply was modified 7 years, 10 months ago by jamiedusa.