WordPress.org

Forums

MMWW
[resolved] {iptc:} templates are printed if the field does not exist (4 posts)

  1. pepe
    Member
    Posted 1 year ago #

    I've found out what actually happened in http://wordpress.org/support/topic/iptcheadline-does-not-work?replies=8

    If the field does not exist, the template strings [iptc:xxxx} are not replaced with an empty string, but remain as is.

    http://wordpress.org/plugins/mmww/

  2. OllieJones
    Member
    Plugin Author

    Posted 1 year ago #

    You can use parentheses to get this plugin to replace metadata tags with empty strings.

    It works like this:

    Suppose you wish to display the IPTC rights usage terms in the item description, if there are any. You put this string into the image description field on the Settings > Media Metadata panel.

    (Terms of use: {iptc:rightsusageterms} )

    If the "iptc:rightsusageterms" metadata item is in the file, you'll get something like this:

    Terms of use: Evaluation Only

    But, if that metadata item is absent, you'll get nothing.

    Notice that it's helpful to precede each ) with a space so when you have multiple optional items they're separated by spaces.

  3. pepe
    Member
    Posted 1 year ago #

    Thanks. It appears I completely misunderstood the syntax.

  4. OllieJones
    Member
    Plugin Author

    Posted 1 year ago #

    It's not the easiest syntax to understand. Thanks for using my plugin!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.