What I am trying to do is have my plugin know when I edit a post that is part of a particular section - let's call it "parts" - which then checks to see if a field is filled out in the form and then hits up an API and then pulls information from it and inserts it into empty fields in the entry.
So to clarify, here is a flow of what I'm looking to do:
- I create an entry in the section "parts".
- Upon saving, it checks to see if the part number field is filled in.
- If the field is filled in it will access an external json api and I'll pull a certain value (or in some cases multiple values) from the array.
- I then want to have it fill in/update/replace the values in fields that I specify that are part of this entry.
So essentially I am trying to figure out how to: Have my plugin trigger once an entry in a specific section is edited or added and then how I can (off of this trigger) have the plugin insert a value (or multiple values) into specific fields in the entry.