I have a shortcode that is built using a Thickbox form with various inputs that return the values. This works fine. However, I would like the existing values (if present) to re-populate the form if the user opens it again.
Here is an example of my shortcode:
[schema type="person" name="Andrew Norcross" description="I make interwebs" ]
I have a working jQuery match function to find the shortcode if it exists:
var code = $('div#wp-content-editor-container textarea').text().match(/\[schema(.*)\]/g);
the code above does get the entire shortcode as a string, but I'm at a loss for how to process it efficiently to get the values I want.
so what I want to accomplish:
- check for a specific part inside the shortcode data (i.e. name="Andrew Norcross")
- get the value inside the quotes and insert it into the field on the form
I've tried a few ways but nothing seems to function as expected.