Elementor\Element_Base::add_child PHP Method

add_child() public method

public add_child ( array $child_data, array $child_args = [] ) : Element_Base | false
$child_data array
$child_args array
return Element_Base | false
    public function add_child(array $child_data, array $child_args = [])
    {
        if (null === $this->_children) {
            $this->_init_children();
        }
        $child_type = $this->_get_child_type($child_data);
        if (!$child_type) {
            return false;
        }
        $child_args = array_merge($child_type->get_default_args(), $child_args);
        $child_class = $child_type->get_class_name();
        $child = new $child_class($child_data, $child_args);
        $this->_children[] = $child;
        return $child;
    }