Code Duplication    Length = 11-15 lines in 2 locations

includes/acf/api/api-template.php 2 locations

@@ 1071-1085 (lines=15) @@
1068
function _validate_save_post() {
1069
	
1070
	// save post_title
1071
	if( isset($_POST['acf']['_post_title']) ) {
1072
		
1073
		// get field
1074
		$field = acf_get_valid_field(array(
1075
			'name'		=> '_post_title',
1076
			'label'		=> 'Title',
1077
			'type'		=> 'text',
1078
			'required'	=> true
1079
		));
1080
		
1081
		
1082
		// validate
1083
		acf_validate_value( $_POST['acf']['_post_title'], $field, "acf[_post_title]" );
1084
	
1085
	}
1086
	
1087
}
1088
@@ 1274-1284 (lines=11) @@
1271
	
1272
	
1273
	// post_title
1274
	if( $args['post_title'] ) {
1275
		
1276
		$fields[] = acf_get_valid_field(array(
1277
			'name'		=> '_post_title',
1278
			'label'		=> 'Title',
1279
			'type'		=> 'text',
1280
			'value'		=> $post_id ? get_post_field('post_title', $post_id) : '',
1281
			'required'	=> true
1282
		));
1283
		
1284
	}
1285
	
1286
	
1287
	// post_content