Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Merge pull request #4 from jmr06005/master
Browse files Browse the repository at this point in the history
Update post name and post title
  • Loading branch information
jmr06005 committed Aug 6, 2015
2 parents 72c4209 + cff26a8 commit 06ee405
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions uc-people.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,24 @@ function create_custom_custom_post_type(){
}
add_action( 'init', 'create_custom_custom_post_type', 0 );

add_filter('title_save_pre', 'save_title');
function save_title($my_post_title) {
if ($_POST['post_type'] == 'person') :
$new_title = get_field( "first_name" ).' '.get_field( "last_name" );
$my_post_title = $new_title;
endif;
return $my_post_title;
}

add_filter('name_save_pre', 'save_name');
function save_name($my_post_name) {
if ($_POST['post_type'] == 'post_type_name') :
$new_name = strtolower(get_field( "first_name" ).'-'.get_field( "last_name" ));
$my_post_name = $new_name;
endif;
return $my_post_name;
}

function processCSV($file){
$data = array();

Expand Down Expand Up @@ -151,6 +169,8 @@ function importFile(){
}
}



function uc_people_settings_page_menu(){
add_submenu_page('tools.php', 'Import People', 'Import People', 'manage_options', 'uc-import-people', 'uc_people_settings_page' );
}
Expand Down

0 comments on commit 06ee405

Please sign in to comment.