title: How to get excerpt in custom field value?
body: <p>On my WordPress website I have a custom field where I would like to add the excerpt of my post into the custom field value.</p>
  
  <p>My code:  </p>
  
  <pre><code>function mk_set_default_custom_fields($post_id)
  {
  if ( $_GET['post_type'] != 'page' ) {
      add_post_meta($post_id, 'key', 'value');
  
  }
  
  return true;
  }
  </code></pre>
  
  <p>How can I place the excerpt of my post into the <code>add_post_meta</code> value once I hit the publish button?</p>