I’m very new here but I’m constantly learning. However, I saw a lot of options to do this auto-publish form in WP several forums but i’m not too sure how and where to include the code? For instance, https://wordpress.org/plugins/post-my-contact-form-7/.
But where should I add this line of code?


function filter_date_to_age($value, $post_id, $form_data){
  //$value is the post field value to return, by default it is empty
  //$post_id is the ID of the post to which the form values are being mapped to
  // $form_data is the submitted form data as an array of field-name=>value pairs
    //calculate the age
    $value = ....
  return $value;

Read more here: How to create a form which will auto publish the submitted content on wordpress?


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: