WordPress.org

Ready to get started?Download WordPress

Forums

Calling custom meta boxes on inline images? (2 posts)

  1. Noel Forte
    Member
    Posted 9 months ago #

    Hey-
    If I have custom meta boxes tied to an image attachment, it shouldn't be too hard to add that information to a post.

    However in the case of inline images within the post content, how would I go about calling information from meta boxes from within the post content?

    Thanks,
    Noel

  2. bcworkz
    Member
    Posted 9 months ago #

    You can't reliably "call" information from content because you have no direct control of what that content is. Shortcodes could "call" information, but the shortcode needs to be placed by the user in order to work.

    Your script could parse through the content before inserting into the DB or outputting to the user's browser, and inject information when the correct content is found, such as <img> tags. But the script would need to be able to distinguish between the proper tag and some other random tag.

    The best approach would depend on the specifics of your need.

Reply

You must log in to post.

About this Topic