refactor id generation for attachment backend
This commit is contained in:
parent
12e5863738
commit
07312cc41c
|
@ -77,8 +77,8 @@ class ComicPressBackendAttachment extends ComicPressBackend {
|
||||||
}
|
}
|
||||||
|
|
||||||
function generate_from_id($id) {
|
function generate_from_id($id) {
|
||||||
if (strpos($id, 'attachment-') === 0) {
|
if (strpos($id, $this->root_id . '-') === 0) {
|
||||||
$id = str_replace('attachment-', '', $id);
|
$id = str_replace($this->root_id . '-', '', $id);
|
||||||
if (is_numeric($id)) {
|
if (is_numeric($id)) {
|
||||||
$post = get_post($id);
|
$post = get_post($id);
|
||||||
if (!empty($post)) {
|
if (!empty($post)) {
|
||||||
|
|
Loading…
Reference in New Issue