$field_name; if (is_string($feed_element) && valid_url($feed_element)) { // straight link usually from options->original_url or options->guid $items[]['embed'] = $feed_element; } elseif (is_array($feed_element)) { foreach ($feed_element as $element) { if (is_array($element)) { // is this an options->enclosure-media->type array if (valid_url($element['link'])) { $items[]['embed'] = $element['link']; } elseif (valid_url($element['player'])) { $items[]['embed'] = $element['player']; } } elseif (is_string($element) && valid_url($element)) { // not sure when this would be called but for completeness $items[]['embed'] = $element; } } } video_cck_field('submit', $node, $field, $items, FALSE, FALSE); $node->$field_name = $items; return $node; } }