Code Duplication    Length = 9-10 lines in 2 locations

geodirectory-admin/admin_functions.php 2 locations

@@ 4256-4264 (lines=9) @@
4253
                                if ( $post_id > 0 && get_post( $post_id ) ) {
4254
                                    $save_post['ID'] = $post_id;
4255
                                    
4256
                                    if ( $saved_post_id = wp_update_post( $save_post, true ) ) {
4257
                                        if ( is_wp_error( $saved_post_id ) ) {
4258
                                            $gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error;
4259
                                            $saved_post_id = 0;
4260
                                        } else {
4261
                                            $saved_post_id = $post_id;
4262
                                            $updated++;
4263
                                        }
4264
                                    }
4265
                                } else {
4266
                                    if ( $saved_post_id = wp_insert_post( $save_post, true ) ) {
4267
                                        if ( is_wp_error( $saved_post_id ) ) {
@@ 4265-4274 (lines=10) @@
4262
                                            $updated++;
4263
                                        }
4264
                                    }
4265
                                } else {
4266
                                    if ( $saved_post_id = wp_insert_post( $save_post, true ) ) {
4267
                                        if ( is_wp_error( $saved_post_id ) ) {
4268
                                            $gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error;
4269
                                            $saved_post_id = 0;
4270
                                        } else {
4271
                                            $created++;
4272
                                        }
4273
                                    }
4274
                                }
4275
                                
4276
                                if ( !$saved_post_id > 0 ) {
4277
                                    $invalid++;