Repeatable custom meta select boxes

To make this work…

$meta == $item->ID ? ' selected="selected"' : '';

… with an array like a:1:{i:0;s:3:"179";} which unserializes to…

Array
(
    [0] => 179
)

… you’d need to do this:

$meta =  unserialize($meta);
$meta[0] == $item->ID ? ' selected="selected"' : '';

But that line shows up inside a foreach like foreach($meta as $row) {, at least in one place, so I am wondering why it isn’t written…

$row == $item->ID ? ' selected="selected"' : '';

And the second time that line– $meta[0] == $item->ID ? ' selected="selected"' : '' — shows up is inside an else that should not execute unless $meta is empty, so it shouldn’t using the variable at all.

I’d suggest that you enable debugging and take a good look around.