Code Duplication    Length = 11-14 lines in 2 locations

geodirectory-functions/post_functions.php 2 locations

@@ 837-847 (lines=11) @@
834
                return false;
835
            }
836
837
            if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $postmeta . "'") != '') {
838
839
                $wpdb->query(
840
                    $wpdb->prepare(
841
                        "UPDATE " . $table . " SET " . $post_meta_set_query . " where post_id = %d",
842
                        array($post_id)
843
                    )
844
                );
845
846
                return true;
847
            }
848
849
        } elseif ($postmeta != '' && $post_id) {
850
            if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $postmeta . "'") != '') {
@@ 849-862 (lines=14) @@
846
                return true;
847
            }
848
849
        } elseif ($postmeta != '' && $post_id) {
850
            if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $postmeta . "'") != '') {
851
852
                $wpdb->query(
853
                    $wpdb->prepare(
854
                        "UPDATE " . $table . " SET " . $postmeta . "= '' where post_id = %d",
855
                        array($post_id)
856
                    )
857
                );
858
859
                return true;
860
            }
861
862
        } else
863
            return false;
864
    }
865
}