Forked from mkdizajn/wordpress plugin rewrite media path
Last active
April 5, 2017 21:47
-
-
Save shahariaazam/1ebbc99b83dee8f4581f28a870af5a1a to your computer and use it in GitHub Desktop.
wordpress plugin rewrite media path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Rewrite Wordpress upload path | |
Plugin URI: http://mkdizajn.com | |
Description: Rewrites your image paths. | |
Version: 2.4 | |
Author: kreso | |
Author URI: http://mkdizajn.com/ | |
*/ | |
function rewrite_url($rewrite) | |
{ | |
$rewrite = str_replace('https://storage.googleapis.com/cdn.publicpowerpost.com', 'http://cdn.publicpowerpost.com', $rewrite); | |
return $rewrite; | |
} | |
add_filter('wp_get_attachment_url', 'rewrite_url'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment