Hi, it can be done with a plugin hook, however you need the Pro version in order to create the hook.
Best Regards
Nickolas
thank you Nick,
that’s good to hear it can be done. I’m more than happy to purchase the Pro version, it’s a useful plug-in.
Would you show me how it is done with some sample code and where to place it, assuming I have one additional user field for the user to enter the details?
Supposing that the caption is entered in the second user field, here is the hook code:
if ( isset($GLOBALS["WFU_GLOBALS"]["WFU_DEBUG"]) ) $GLOBALS["WFU_GLOBALS"]["WFU_DEBUG"][3] = "ON";
if (!function_exists('wfu_debug_wfu_process_media_insert_function_handler')) {
function wfu_debug_wfu_process_media_insert_function_handler($res, $file_path, $userdata_fields, $page_id) {
$attach_id = $res["output"];
if ( $attach_id ) {
$caption = ( isset($userdata_fields[1]) ? $userdata_fields[1]["value"] : "" );
$args = array( 'ID' => $attach_id, 'post_excerpt' => $caption );
wp_update_post( $args );
}
$res["result"] = 'R';
return $res;
}
add_filter('wfu_debug-wfu_process_media_insert', 'wfu_debug_wfu_process_media_insert_function_handler', 10, 4);
$GLOBALS['wfu_debug_end-wfu_process_media_insert'] = "1";
}
You need to put it in Hooks tab in plugin’s Dashboard area.
You can also put it in functions.php file of your theme. However the hook will be lost when you update the theme.
Nickolas