support for arrays in backend_url_image in prep for meta box
This commit is contained in:
parent
ab3af9244a
commit
cae60abc4f
|
@ -121,8 +121,14 @@ class ComicPressMediaHandling {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result = get_post_meta($post_to_use->ID, "backend_url_images", true)) {
|
if ($result = get_post_meta($post_to_use->ID, "backend_url_images", true)) {
|
||||||
|
$types = false;
|
||||||
if (is_string($result)) {
|
if (is_string($result)) {
|
||||||
parse_str($result, $types);
|
parse_str($result, $types);
|
||||||
|
}
|
||||||
|
if (is_array($result)) {
|
||||||
|
$types = $result;
|
||||||
|
}
|
||||||
|
if (is_array($types)) {
|
||||||
if (isset($types[$type])) {
|
if (isset($types[$type])) {
|
||||||
return $types[$type];
|
return $types[$type];
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,6 +183,7 @@ class ComicPressMediaHandlingTest extends PHPUnit_Framework_TestCase {
|
||||||
array('comic', array('backend_url_comic' => '/test'), '/test'),
|
array('comic', array('backend_url_comic' => '/test'), '/test'),
|
||||||
array('comic', array('backend_url_images' => 'test=/test'), false),
|
array('comic', array('backend_url_images' => 'test=/test'), false),
|
||||||
array('comic', array('backend_url_images' => 'comic=/test'), '/test'),
|
array('comic', array('backend_url_images' => 'comic=/test'), '/test'),
|
||||||
|
array('comic', array('backend_url_images' => array('comic' => '/test')), '/test'),
|
||||||
array('comic', array('backend_url' => '/test'), '/test'),
|
array('comic', array('backend_url' => '/test'), '/test'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue