I have a div with inputs within it in my document, and I would like to be able to save more than just each input’s value in a function, run during the save_post hook. for testing, it looks like this at the moment:
$sanitized_data = array();
foreach ( $resources as $index=>$resource ) {
$resource = esc_url( strip_tags( $resource ) );
if ( ! empty( $resource ) ) {
$sanitized_data[$index] = $resource;
}
}
$myDocument->update_post_meta(
$post_id,
'Meta_key',
$sanitized_data
);
I’m not sure how to retrieve any other information, and I suspect when the save_post action is run the document no longer exists, only the meta data, or at least that’s the way it seems.
I created this function to try and see what was going on:
$elements = $this->getElementsByTagName('input_wrapper');
foreach($elements as $index=>$child) {
var_dump( $child );
}
die();
Unfortunately, this comes up with nothing but a blank screen. Can anyone help me?