function element_get_visible_children
element_get_visible_children(array $elements)
Returns the visible children of an element.
Parameters
$elements: The parent element.
Return value
The array keys of the element's visible children.
File
- includes/common.inc, line 6601
- Common functions that many Drupal modules will need to reference.
Code
function element_get_visible_children(array $elements) { $visible_children = array(); foreach (element_children($elements) as $key) { $child = $elements[$key]; // Skip un-accessible children. if (isset($child['#access']) && !$child['#access']) { continue; } // Skip value and hidden elements, since they are not rendered. if (isset($child['#type']) && in_array($child['#type'], array('value', 'hidden'))) { continue; } $visible_children[$key] = $child; } return array_keys($visible_children); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!common.inc/function/element_get_visible_children/7.x