I have been searching for a while but cant find an answer for what i need. If i insert an image in a post it gets wrapped by a p like this:

<p> <img class="alignnone size-full wp-image-97286" src alt width height ></p>

But i dont know where this code is being generated. I need to add a condition to this

and if the condition checks ill add a span class to this p. Anyone to point me in the right direction?

Read more here: Manipulate images inside the content of a post


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: