diff --git a/classes/ComicPressAdmin.inc b/classes/ComicPressAdmin.inc index 114ec73..b223114 100644 --- a/classes/ComicPressAdmin.inc +++ b/classes/ComicPressAdmin.inc @@ -218,7 +218,9 @@ class ComicPressAdmin { $media_post->post_parent = $settings['post_parent']; wp_update_post($media_post); } - update_post_meta($post_id, 'comicpress_management', isset($settings['comicpress_management'])); + update_post_meta($post_id, 'comicpress', array( + 'managed' => isset($settings['comicpress_management'] + ))); } } diff --git a/classes/backends/ComicPressBackendAttachment.inc b/classes/backends/ComicPressBackendAttachment.inc index b013330..5bed84f 100644 --- a/classes/backends/ComicPressBackendAttachment.inc +++ b/classes/backends/ComicPressBackendAttachment.inc @@ -17,7 +17,8 @@ class ComicPressBackendAttachment extends ComicPressBackend { if (!empty($children)) { foreach ($children as $child) { - if (get_post_meta($child->ID, 'comicpress_management', true)) { + $meta = get_post_meta($child->ID, 'comicpress', true); + if ($meta['managed']) { $result[] = new ComicPressBackendAttachment($child); } } diff --git a/test/ComicPressAdminTest.php b/test/ComicPressAdminTest.php index 8e359e4..9ddd5bd 100644 --- a/test/ComicPressAdminTest.php +++ b/test/ComicPressAdminTest.php @@ -92,7 +92,9 @@ class ComicPressAdminTest extends PHPUnit_Framework_TestCase { ), array( 'post_meta' => array( - 'comicpress_management' => true + 'comicpress' => array( + 'managed' => true + ) ), ), ), @@ -126,7 +128,9 @@ class ComicPressAdminTest extends PHPUnit_Framework_TestCase { 'post_parent' => 2, ), 'post_meta' => array( - 'comicpress_management' => true + 'comicpress' => array( + 'managed' => true + ) ) ), )