Number of Style for Image Added into Post

admin2025-06-04  0

When adding an image through the GUI, an HTML element is created:

<img src=".jpg" 
alt="leaf graphic" 
title="leaf graphic" 
class="alignright size-medium wp-image-3109" 
height="25" width="30"/>

A sequential 3109 and a style name wp-image-3109 (?) is generated.

Besides, I cannot find it in any table in the DB (wp_posts, wp_postmeta or any other table). How the next ID must be generated? Is there a WP PHP function returning it?

Thanks in advance.

When adding an image through the GUI, an HTML element is created:

<img src="http://example/images/leaf.jpg" 
alt="leaf graphic" 
title="leaf graphic" 
class="alignright size-medium wp-image-3109" 
height="25" width="30"/>

A sequential 3109 and a style name wp-image-3109 (?) is generated.

Besides, I cannot find it in any table in the DB (wp_posts, wp_postmeta or any other table). How the next ID must be generated? Is there a WP PHP function returning it?

Thanks in advance.

Share Improve this question edited Jan 19, 2019 at 20:18 Brethlosze asked Jan 19, 2019 at 20:06 BrethloszeBrethlosze 1491 gold badge2 silver badges11 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

I’m not sure if I understand your question correctly, but...

In WP any attachment is a post (of attachment type). So 3109 is ID of that post.

This means, that if you’ll take a look at wp_posts table, then you should find that post and there should be some additional info stored as meta fields in wp_postmeta table (for example sizes of all generated images are stored as meta).

So the ID of next uploaded image will be the next value of ID column in wp_posts table.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748994082a315457.html

最新回复(0)