wp-includes/class-wp-walker.php:420Calculates the total number of root elements.
$elementsarrayint public function get_number_of_root_elements( $elements ) { $num = 0; $parent_field = $this->db_fields['parent']; foreach ( $elements as $e ) { if ( empty( $e->$parent_field ) ) { ++$num; } } return $num; }Introduced in 2.7.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/class-wp-walker.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.