Thanks for the links to your example image and for all the testing and experimenting you’ve done. It’s not entirely fair to blame PHP, since all of the code required to parse out the XMP data is mine and mine alone, i.e., code within the MLA plugin.
The best way to find the “magic keys” is to start with something like this in your mla_caption
:
mla_caption="{+xmp:Iptc4xmpCore,export+}"
or mla_caption="{+xmp:Iptc4xmpExt,export+}"
The ,export
format option will dump the entire sub-structure showing how MLA has parsed it. For your example this yields:
Iptc4xmpCore
array ( ‘Copyright’ => ‘Wes Mitchell’, ‘Caption’ => ‘photos from Panoche Hills’, ‘Location’ => ‘Panoche Hills’, ‘IntellectualGenre’ => ‘astrophotography’, ‘CreatorContactInfo’ => array ( ‘CiEmailWork’ => ‘[email protected]’, ‘CiUrlWork’ => ‘https://dancinglight.photos’, ), ‘Scene’ => array ( 0 => ‘011100’, ), ‘SubjectCode’ => array ( 0 => ‘01000000’, ), )
and
Iptc4xmpExt
array ( ‘PersonInImage’ => array ( 0 => ‘NOBODY’, ), ‘LocationCreated’ => array ( 0 => array ( ‘Sublocation’ => ‘Panoche Hills Recreation Area’, ‘City’ => ”, ‘ProvinceState’ => ‘California’, ‘CountryName’ => ‘US’, ‘CountryCode’ => ‘USA’, ‘WorldRegion’ => ”, ), ), ‘LocationShown’ => array ( 0 => array ( ‘Sublocation’ => ‘Panoche Hills Recreation Area’, ‘City’ => ”, ‘ProvinceState’ => ‘California’, ‘CountryName’ => ‘US’, ‘CountryCode’ => ‘USA’, ‘WorldRegion’ => ”, ), ), ‘Event’ => array ( 0 => ‘EVENT’, ), )
Your followup example did not work for me, but I had luck with this variation:
{+xmp:Iptc4xmpExt.LocationCreated.0.Sublocation+}
Does all that make sense?