get_atomic_settings(); // TODO: Move the validation/sanitization to the props schema constraints. $escaped_tag = Utils::validate_html_tag( $settings['tag'] ); $escaped_title = esc_html( $settings['title'] ); $class = ''; if ( ! empty( $settings['classes'] ) ) { $class = "class='" . esc_attr( $settings['classes'] ) . "'"; } // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo "<$escaped_tag $class>$escaped_title"; } protected function define_atomic_controls(): array { $tag_control = Select_Control::bind_to( 'tag' ) ->set_label( esc_html__( 'Tag', 'elementor' ) ) ->set_options( [ [ 'value' => 'h1', 'label' => 'H1', ], [ 'value' => 'h2', 'label' => 'H2', ], [ 'value' => 'h3', 'label' => 'H3', ], [ 'value' => 'h4', 'label' => 'H4', ], [ 'value' => 'h5', 'label' => 'H5', ], [ 'value' => 'h6', 'label' => 'H6', ], ]); $title_control = Textarea_Control::bind_to( 'title' ) ->set_label( __( 'Title', 'elementor' ) ) ->set_placeholder( __( 'Type your title here', 'elementor' ) ); $tag_and_title_section = Section::make() ->set_label( __( 'Content', 'elementor' ) ) ->set_items( [ $tag_control, $title_control, ]); return [ $tag_and_title_section, ]; } protected static function define_props_schema(): array { return [ 'classes' => Atomic_Prop::make(), 'tag' => Atomic_Prop::make() ->default( 'h2' ), 'title' => Atomic_Prop::make() ->default( __( 'Your Title Here', 'elementor' ) ), ]; } }