Skip to content

Instantly share code, notes, and snippets.

@aaroneaton
Last active December 16, 2015 07:19
Show Gist options
  • Save aaroneaton/5397724 to your computer and use it in GitHub Desktop.
Save aaroneaton/5397724 to your computer and use it in GitHub Desktop.
Saving a meta field as the post title
<?php
public function save_title( $title ) {
if ( $_POST['post_type'] == 'my_post_type' ){
$title = $_POST['_meta_program-title'];
}
return $title;
}
add_filter( 'title_save_pre', 'save_title' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment