Support » Plugins and Hacks » Get value of HTML tags?
8 years, 10 months ago
I’m developing a plugin that has a hook for the_content. When it is passed this, it identifies some parameters in an img tag. For example:
<img src="http://example.com/blah.png" protect="http://an-image-host.com/blah.png" />
How can I get the values from src and protect? I figured someone here would be able to help, because many plugins allow users to pass parameters through HTML.
(Also, if the earlier issue is resolved, after I get the values and evaluate something, how can I select that entire string and replace it with a different image string?) For example, replacing this:
<img src="http://an-image-host.com/blah.png" />
<img src="http://example.com/blah.png" />
depending on what the outcome is from one of my functions.