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

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


  2. OllieJones
    Plugin Author

    Posted 2 years 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
    Posted 2 years ago #

    Thanks. It appears I completely misunderstood the syntax.

  4. OllieJones
    Plugin Author

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

  • MMWW
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.