Code Duplication    Length = 9-10 lines in 2 locations

geodirectory-admin/admin_functions.php 2 locations

@@ 4593-4601 (lines=9) @@
4590
                                if ( $post_id > 0 && get_post( $post_id ) ) {
4591
                                    $save_post['ID'] = $post_id;
4592
                                    
4593
                                    if ( $saved_post_id = wp_update_post( $save_post, true ) ) {
4594
                                        if ( is_wp_error( $saved_post_id ) ) {
4595
                                            $gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error;
4596
                                            $saved_post_id = 0;
4597
                                        } else {
4598
                                            $saved_post_id = $post_id;
4599
                                            $updated++;
4600
                                        }
4601
                                    }
4602
                                } else {
4603
                                    if ( $saved_post_id = wp_insert_post( $save_post, true ) ) {
4604
                                        if ( is_wp_error( $saved_post_id ) ) {
@@ 4602-4611 (lines=10) @@
4599
                                            $updated++;
4600
                                        }
4601
                                    }
4602
                                } else {
4603
                                    if ( $saved_post_id = wp_insert_post( $save_post, true ) ) {
4604
                                        if ( is_wp_error( $saved_post_id ) ) {
4605
                                            $gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error;
4606
                                            $saved_post_id = 0;
4607
                                        } else {
4608
                                            $created++;
4609
                                        }
4610
                                    }
4611
                                }
4612
                                
4613
                                if ( !$saved_post_id > 0 ) {
4614
                                    $invalid++;