Code Duplication    Length = 5-6 lines in 2 locations

geodirectory-functions/custom_functions.php 1 location

@@ 781-785 (lines=5) @@
778
			if ( isset( $_REQUEST['pid'] ) && $_REQUEST['pid'] != '' ) {
779
				$post_id = $_REQUEST['pid'];
780
			}
781
		} elseif ( isset( $_REQUEST['pid'] ) && $_REQUEST['pid'] != '' ) {
782
			$post      = geodir_get_post_info( $_REQUEST['pid'] );
783
			$post_type = $post->post_type;
784
			$post_id   = $_REQUEST['pid'];
785
		} elseif ( isset( $post->post_type ) && $post->post_type != '' ) {
786
			$post_type = $post->post_type;
787
			$post_id   = $post->ID;
788
		}

geodirectory_template_actions.php 1 location

@@ 2413-2418 (lines=6) @@
2410
2411
            $listing_type = $post->listing_type;
2412
2413
        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2414
            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2415
            $listing_type = $post->post_type;
2416
            $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2417
2418
        } else {
2419
            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2420
        }
2421