Why are <img> tags inserted into posts?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Why are <img> tags inserted into posts?

MikeD
I'm wondering why an actual HTML <img> link is embedded into a post when inserting an image, as opposed to a shortcode such as

[img id=123 size='medium' alt='alt']

or something similar that would make site-wide changes to image sizes etc easier. Is it just the DB hit or was there some other reason? I'd love to read the history of this if it exists somewhere.
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Why are <img> tags inserted into posts?

John Blackbourn
There isn't really a "history" to this, and there certainly wasn't a
design decision. It's just how it is. Shortcodes weren't introduced
until version 2.5, four years after version 1.0.

Along with root-relative URLs, this gets brought up from time to time,
for example https://core.trac.wordpress.org/ticket/11394. There's not
much benefit to an img shortcode over an img tag, and there are
downsides such as (as you pointed out) additional database queries.

John

On 19 May 2015 at 21:25, MikeD <[hidden email]> wrote:
> I'm wondering why an actual HTML <img> link is embedded into a post when inserting an image, as opposed to a shortcode such as
>
> [img id=123 size='medium' alt='alt']
>
> or something similar that would make site-wide changes to image sizes etc easier. Is it just the DB hit or was there some other reason? I'd love to read the history of this if it exists somewhere.
> _______________________________________________
> wp-hackers mailing list
> [hidden email]
> http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers