Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request weblab#8 from szk11001/master
Updating post title and name
  • Loading branch information
jmr06005 committed Sep 2, 2015
2 parents b203a65 + 7e6c53a commit 116633d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions uc-people.php
Expand Up @@ -79,7 +79,7 @@ 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 = $_POST['fields']['field_first_name'].' '.$_POST['fields']['field_first_name'];
$new_title = $_POST['acf']['field_first_name'].' '.$_POST['acf']['field_last_name'];
$my_post_title = $new_title;
endif;
return $my_post_title;
Expand All @@ -88,27 +88,27 @@ function save_title($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($_POST['fields']['field_first_name'].' '.$_POST['fields']['field_first_name']);
$new_name = strtolower($_POST['acf']['field_first_name'].' '.$_POST['acf']['field_last_name']);
$my_post_name = $new_name;
endif;
return $my_post_name;
}
if(!function_exists('processCSV')){
function processCSV($file){
$data = array();

$fh = fopen($file, 'r');
if( $fh == false ){
return;
}
$header = fgetcsv($fh);

while( $line = fgetcsv($fh) ) {
$data[] = array_combine($header, $line);
}

fclose($fh);

return $data;
}
}
Expand Down

0 comments on commit 116633d

Please sign in to comment.