private function attachmentExists($src)
    {
        global $wpdb;
        $query = "SELECT ID FROM {$wpdb->posts} WHERE guid = '$src'";
        $id = $wpdb->get_var($query);

        if (!empty($id) && $id > 0) {
            return $id;
        }

        return false;
    }
private function attachmentExists($src)
    {
        global $wpdb;
        $query = "SELECT ID FROM {$wpdb->posts} WHERE guid = '$src'";
        $id = $wpdb->get_var($query);

        if (!empty($id) && $id > 0) {
            return $id;
        }

        return false;
    }
private function attachmentExists ( $ src ) { global $ wpdb ; $ query = "SELECT ID FROM {$wpdb->posts} WHERE guid = '$src'" ; $ id = $ wpdb -> get_var ( $ query ) ; if ( ! empty ( $ id ) && $ id > 0 ) { return $ id ; } return false ; }
Checks if a attachment src already exists in media library
@param  string $src Media url
@return mixed
Checks if a attachment src already exists in media library