Code Duplication    Length = 9-10 lines in 2 locations

geodirectory-admin/admin_functions.php 2 locations

@@ 4526-4534 (lines=9) @@
4523
                                if ( $post_id > 0 && get_post( $post_id ) ) {
4524
                                    $save_post['ID'] = $post_id;
4525
                                    
4526
                                    if ( $saved_post_id = wp_update_post( $save_post, true ) ) {
4527
                                        if ( is_wp_error( $saved_post_id ) ) {
4528
                                            $gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error;
4529
                                            $saved_post_id = 0;
4530
                                        } else {
4531
                                            $saved_post_id = $post_id;
4532
                                            $updated++;
4533
                                        }
4534
                                    }
4535
                                } else {
4536
                                    if ( $saved_post_id = wp_insert_post( $save_post, true ) ) {
4537
                                        if ( is_wp_error( $saved_post_id ) ) {
@@ 4535-4544 (lines=10) @@
4532
                                            $updated++;
4533
                                        }
4534
                                    }
4535
                                } else {
4536
                                    if ( $saved_post_id = wp_insert_post( $save_post, true ) ) {
4537
                                        if ( is_wp_error( $saved_post_id ) ) {
4538
                                            $gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error;
4539
                                            $saved_post_id = 0;
4540
                                        } else {
4541
                                            $created++;
4542
                                        }
4543
                                    }
4544
                                }
4545
                                
4546
                                if ( !$saved_post_id > 0 ) {
4547
                                    $invalid++;