Hi,
Let’s say you have an image , and in HTML code , it shows like this
<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="429" src="https://my.domain.com/wp-content/uploads/2020/10/test.png" alt="" class="wp-image-25" srcset="https://my.domain.com/wp-content/uploads/2020/10/test.png 1024w, https://my.domain.com/wp-content/uploads/2020/10/test-300x126.png 300w, https://my.domain.com/wp-content/uploads/2020/10/test-768x322.png 768w, https://my.domain.com/wp-content/uploads/2020/10/test-1536x644.png 1536w, https://my.domain.com/wp-content/uploads/2020/10/test-1200x503.png 1200w, https://my.domain.com/wp-content/uploads/2020/10/test.png 1970w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
full path URL is like
/wp-content/uploads/2020/10/test.png
/wp-content/uploads/2020/10/test-1200x503.png
/wp-content/uploads/2020/10/test-768x322.png
any common string in above 3 , are good for partial URL , for example
/wp-content/uploads/2020/10/test
/wp-content/uploads/2020
/wp-content/
all of these 3 examples can match all the images URI in above example
sometimes you may want to exclude it by class name , in above example , the parent class name “wp-block-image” and “size-large” , but this example doesn’t have class name ,it should be show as within <img tag ,
e.g. : <img class="test" src="https://my.domain.com/wp-content/uploads/2020/10/test.png" .... />
in this case , the image class is “test”
Best regards,
-
This reply was modified 4 years, 1 month ago by qtwrk.