make the metadata a bit smarter

This commit is contained in:
John Bintz 2009-11-10 22:12:47 -05:00
parent aa7d5e0dfa
commit 70867b8045
3 changed files with 11 additions and 4 deletions

View File

@ -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']
)));
}
}

View File

@ -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);
}
}

View File

@ -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
)
)
),
)