make the metadata a bit smarter
This commit is contained in:
parent
aa7d5e0dfa
commit
70867b8045
|
@ -218,7 +218,9 @@ class ComicPressAdmin {
|
||||||
$media_post->post_parent = $settings['post_parent'];
|
$media_post->post_parent = $settings['post_parent'];
|
||||||
wp_update_post($media_post);
|
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']
|
||||||
|
)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,8 @@ class ComicPressBackendAttachment extends ComicPressBackend {
|
||||||
|
|
||||||
if (!empty($children)) {
|
if (!empty($children)) {
|
||||||
foreach ($children as $child) {
|
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);
|
$result[] = new ComicPressBackendAttachment($child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,9 @@ class ComicPressAdminTest extends PHPUnit_Framework_TestCase {
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'post_meta' => 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_parent' => 2,
|
||||||
),
|
),
|
||||||
'post_meta' => array(
|
'post_meta' => array(
|
||||||
'comicpress_management' => true
|
'comicpress' => array(
|
||||||
|
'managed' => true
|
||||||
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue