Code Duplication    Length = 19-19 lines in 2 locations

classes/PodsMeta.php 2 locations

@@ 1272-1290 (lines=19) @@
1269
		$data = array();
1270
1271
		if ( false !== $nonced && ! empty( $groups ) ) {
1272
			foreach ( $groups as $group ) {
1273
				if ( empty( $group['fields'] ) ) {
1274
					continue;
1275
				}
1276
1277
				foreach ( $group['fields'] as $field ) {
1278
					if ( false === PodsForm::permission( $field['type'], $field['name'], $field, $group['fields'], $pod, $id ) ) {
1279
						if ( ! pods_v( 'hidden', $field['options'], false ) ) {
1280
							continue;
1281
						}
1282
					}
1283
1284
					$data[ $field['name'] ] = '';
1285
1286
					if ( isset( $_POST[ 'pods_meta_' . $field['name'] ] ) ) {
1287
						$data[ $field['name'] ] = $_POST[ 'pods_meta_' . $field['name'] ];
1288
					}
1289
				}
1290
			}
1291
1292
			if ( $is_new_item ) {
1293
				do_action( 'pods_meta_create_pre_post', $data, $pod, $id, $groups, $post, $post->post_type );
@@ 1827-1845 (lines=19) @@
1824
		$data = array();
1825
1826
		if ( false !== $nonced && ! empty( $groups ) ) {
1827
			foreach ( $groups as $group ) {
1828
				if ( empty( $group['fields'] ) ) {
1829
					continue;
1830
				}
1831
1832
				foreach ( $group['fields'] as $field ) {
1833
					if ( false === PodsForm::permission( $field['type'], $field['name'], $field, $group['fields'], $pod, $id ) ) {
1834
						if ( ! pods_v( 'hidden', $field['options'], false ) ) {
1835
							continue;
1836
						}
1837
					}
1838
1839
					$data[ $field['name'] ] = '';
1840
1841
					if ( isset( $_POST[ 'pods_meta_' . $field['name'] ] ) ) {
1842
						$data[ $field['name'] ] = $_POST[ 'pods_meta_' . $field['name'] ];
1843
					}
1844
				}
1845
			}
1846
1847
			if ( $is_new_item ) {
1848
				do_action( 'pods_meta_create_pre_user', $data, $pod, $id, $groups );