[wp-hackers] shortcode for images?

scribu scribu at gmail.com
Thu Jan 29 18:47:47 GMT 2009


On Thu, Jan 29, 2009 at 8:36 PM, Paul <paul at codehooligans.com> wrote:

> All,
>
> Just wondering is there are any future core plans to replace the full URL
> of images inserted into Posts/Pages with some new image shortcode?
>
> Historically I've always disagreed with placing the full image URL into the
> post body since this limits the overall blog portability. As a full-time
> developer I usually develop the client WordPress site on my local system.
> This includes importing any legacy blog posts, images, documents, etc. When
> I push this to the client server I have to search and replace the local URL
> the client site URL. Not s big issue really I know.
>
> Another example. I'm converting this HRC blog site
> http://www.hrcbackstory.org/ from TypePad to a self-hosted WordPress
> instance http://blogstaging.hrcsupport.org. The site has over 1460 posts
> and most post have 2 or more images. The dev URL '
> blogstaging.hrcsupport.org' used for the staging site will need to be
> updated when they point the live domain 'www.hrcbackstory.org' to the
> self-hosted WordPress site end of next week. At that time I'll need to
> update the database. Again, not a big issue. But would be nice if the client
> could do this themselves. I was thinking there could be a cleaner way.
>
> Seems that shortcodes are all the rage now. Most media plugin developers
> are utilizing them quite well. So why is WordPress still using the full URL
> for the image source? I noticed the new image caption already uses shortcode
> [caption... ]. Seems it would not be a big task to use a shortcode for the
> image itself. Just wondering.
>
> Paul Menard
> http://www.codehooligans.com
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>

You could use the Search & Replace plugin instead of querying the database
directly.

As for the shortcode, several dissadvantages:
- extra processing for each shortcode
- what happens with images that aren't hosted on the same host?
- both the rich editor and all the export scripts would have to be updated

Advantages? Not so many.


-- 
http://scribu.net


More information about the wp-hackers mailing list