self::newId(), 'elType' => 'section', 'settings' => $settings, 'elements' => $columns, 'isInner' => false, ]; } /** * A column node, full-width by default. * * @param array $widgets Widget nodes. * @param array $settings Column settings. * @return array */ public static function column( $widgets, $settings = [] ) { return [ 'id' => self::newId(), 'elType' => 'column', 'settings' => array_merge( [ '_column_size' => 100 ], $settings ), 'elements' => $widgets, ]; } /** * A widget node. * * @param string $widget_type Elementor widget slug (its `get_name()`). * @param array $settings Widget settings. * @return array */ public static function widget( $widget_type, $settings = [] ) { return [ 'id' => self::newId(), 'elType' => 'widget', 'widgetType' => $widget_type, 'settings' => $settings, 'elements' => [], ]; } /** * Convenience: wrap a single widget in its own full-width section/column. * * @param array $widget Widget node. * @return array Section node. */ public static function sectionFor( $widget ) { return self::section( [ self::column( [ $widget ] ) ] ); } /** * Core `heading` widget. * * @param string $text Heading text. * @param string $size Header tag (h1-h6). * @return array */ public static function headingWidget( $text, $size = 'h2' ) { return self::widget( 'heading', [ 'title' => $text, 'header_size' => $size, ] ); } /** * Core `text-editor` widget. Accepts HTML. * * @param string $html Editor content. * @return array */ public static function textWidget( $html ) { return self::widget( 'text-editor', [ 'editor' => $html ] ); } /** * `