function get_attachment_id_from_url_without_resolution($url) { $file = all_around_functions::get_relative_to_cms_urlpath_from_full_urlpath($url); $upload_dir = $this->get_full_urlpath_of_uploads_dir(1); $upload_dir_length = strlen($upload_dir); if (substr($url, 0, $upload_dir_length) == $upload_dir) { $file = substr($url, $upload_dir_length); $query = "SELECT post_id FROM " . $this->get_db_postmeta_table() . " WHERE meta_value LIKE '%" . $file . "%'"; $id = $this->db_get_var($query); if ($id == NULL) { return NULL; } return $id; } return NULL; }