Hi everyone , thanks for reading.
Environment :
Wordpress Plugin + Additional Custom Fields
Problem:
I searched for several hours, and I cannot find the correct syntax to do the following:
When you publish a new message, get the value of the custom field to automatically replace the message header with this value. Example: I create a message and set the '10am' to my time 'user field. The message header is automatically replaced with "10 a.m."
Example:
So, I add a filter with the following:
add_filter('wp_insert_post_data', 'change_title') ;
function change_title($data)
{
$time = XXX ;
$new_title = 'Topic created at'.$time ;
$data['post_title'] = $time ;
return $data;
}
, , WP, . , - , .
!