refactor id generation for attachment backend

This commit is contained in:
John Bintz 2009-11-12 08:02:06 -05:00
parent 12e5863738
commit 07312cc41c
1 changed files with 2 additions and 2 deletions

View File

@ -77,8 +77,8 @@ class ComicPressBackendAttachment extends ComicPressBackend {
}
function generate_from_id($id) {
if (strpos($id, 'attachment-') === 0) {
$id = str_replace('attachment-', '', $id);
if (strpos($id, $this->root_id . '-') === 0) {
$id = str_replace($this->root_id . '-', '', $id);
if (is_numeric($id)) {
$post = get_post($id);
if (!empty($post)) {