WordPress.org

Ready to get started?Download WordPress

Forums

Get value of HTML tags? (2 posts)

  1. sandman85
    Member
    Posted 6 years 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://example.com/blah.png" protect="http://an-image-host.com/blah.png" />

    with this:

    <img src="http://an-image-host.com/blah.png" />

    or this:

    <img src="http://example.com/blah.png" />

    depending on what the outcome is from one of my functions.

    Thanks,
    sandman

  2. sandman85
    Member
    Posted 6 years ago #

    Bump...

Topic Closed

This topic has been closed to new replies.

About this Topic