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

  1. Noel Forte
    Posted 2 years ago #

    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?


  2. bcworkz
    Posted 2 years 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.

Topic Closed

This topic has been closed to new replies.

About this Topic