[wp-hackers] What's the best solution to develop a website in sandbox?
Christopher Ross
cross at thisismyurl.com
Sat Jul 16 19:00:37 UTC 2011
On 2011-07-16, at 12:15 PM, Bill Dennen wrote:
>>
>> Personally, this whole process is one of the most annoying parts of using
>> WP as the basis for websites. The idea that all the urls are hardcoded all
>> over the place in the db still boggles my mind, but I have heard it from the
>> mouth (in person) from those in charge that this will never change.
>
> I agree with Andrew. I hate seeing those URLs hard-coded in the database,
> too! Moving WordPress (especially a multisite network) is too hard.
>
> For those "in charge" : Is it true that this will never change?
Bill, I don't know what the answer is regarding if/when it'll change but it's an easy override for you if it bugs you. This code will replace occurrence of your url address in your text with a relative path. I'm sure somebody out there has a better function for it but it's done the job for me over the years.
c.
function thisismyurl_clean_static_url($content) {
return str_replace('href="'get_bloginfo('url'), 'href="', $content );
return str_replace('src="'get_bloginfo('url'), 'src="', $content );
}
add_filter('content_save_pre','thisismyurl_clean_static_url','99');
--
Christopher Ross
christopher.ross at rodonic.com
Rodonic - http://rodonic.com
My Blog - http://thisismyurl.com
Twitter - http://twitter.com/#!/thisismyurl
Facebook - http://www.facebook.com/thisismyurlcom
(416) 900-3731
More information about the wp-hackers
mailing list