Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Irfan-Ansari/f1b9f4b84e9bc475b280 to your computer and use it in GitHub Desktop.
Save Irfan-Ansari/f1b9f4b84e9bc475b280 to your computer and use it in GitHub Desktop.
Replace the Post Excerpt Meta Box with a Field in My Custom Meta Box
<?php
function my_custom_save_function($post_id){
update_post(array('ID' => $post_id, 'post_excerpt' => $_POST['my_custom_field']));
}
add_action('save_post', 'my_custom_save_function');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment