Skip to content

Instantly share code, notes, and snippets.

@aaroneaton
Last active December 12, 2015 12:38
Show Gist options
  • Save aaroneaton/4773149 to your computer and use it in GitHub Desktop.
Save aaroneaton/4773149 to your computer and use it in GitHub Desktop.
WP:Saving meta fields as post title
<?php
public function save_staff_title( $staff_title ) {
$first = $_POST[META_PREFIX . 'first-name'];
$last = $_POST[META_PREFIX . 'last-name'];
if ( $_POST['post_type'] == 'staff' )
$staff_title = $last . ', ' . $first;
return $staff_title;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment