From 8b8c21f6500ff45e777e763a49fe78e20a582ee0 Mon Sep 17 00:00:00 2001 From: Maggie Serino Date: Mon, 16 Sep 2024 14:35:03 +0200 Subject: [PATCH] TMZ-54 fix phpcs --- modules/admin/components/settings.php | 3 +- .../classes/render/widget-zig-zag-render.php | 12 ++-- modules/content/widgets/zig-zag.php | 56 +++++++++---------- 3 files changed, 35 insertions(+), 36 deletions(-) diff --git a/modules/admin/components/settings.php b/modules/admin/components/settings.php index 592ab585..6de68d6f 100644 --- a/modules/admin/components/settings.php +++ b/modules/admin/components/settings.php @@ -35,8 +35,7 @@ public function settings_page() { add_action( 'load-' . $menu_hook, function () { add_action( 'admin_enqueue_scripts', [ $this, 'settings_page_scripts' ], 10 ); //phpcs:ignore - } - ); + } ); } /** diff --git a/modules/content/classes/render/widget-zig-zag-render.php b/modules/content/classes/render/widget-zig-zag-render.php index d623bc45..bd501789 100644 --- a/modules/content/classes/render/widget-zig-zag-render.php +++ b/modules/content/classes/render/widget-zig-zag-render.php @@ -73,7 +73,7 @@ private function render_graphic_element_container( $item, $key ) { if ( $is_icon ) { $graphic_element_classnames .= ' has-icon'; - } else if ( $is_image ) { + } elseif ( $is_image ) { $graphic_element_classnames .= ' has-image'; } @@ -103,7 +103,7 @@ private function render_text_element_container( $item, $key ) { $title_text = $item[ $graphic_element . '_title' ] ?? ''; $has_title = ! empty( $title_text ); - $description_text = $item[ $graphic_element . '_description'] ?? ''; + $description_text = $item[ $graphic_element . '_description' ] ?? ''; $has_description = ! empty( $description_text ); $button_classnames = 'e-zigzag__button'; @@ -167,10 +167,10 @@ private function render_text_element_container( $item, $key ) {
widget->get_render_attribute_string( 'button-link-' . $key ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> 'true', - 'class' => 'e-zigzag__button-icon', - ] ); ?> + [ + 'aria-hidden' => 'true', + 'class' => 'e-zigzag__button-icon', + ] ); ?>
diff --git a/modules/content/widgets/zig-zag.php b/modules/content/widgets/zig-zag.php index 1a377eb4..85f1c607 100644 --- a/modules/content/widgets/zig-zag.php +++ b/modules/content/widgets/zig-zag.php @@ -65,7 +65,7 @@ protected function add_style_section() { $this->add_box_style_section(); } - private function add_zigzags_content_section( ) { + private function add_zigzags_content_section() { $this->start_controls_section( 'zigzags_content_section', [ @@ -175,7 +175,7 @@ private function add_graphic_element_repeater( $type ) { $repeater->add_control( $type . '_title_tag', [ - 'label' => esc_html__( 'HTML Tag', 'elementor' ), + 'label' => esc_html__( 'HTML Tag', 'hello-plus' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'h1' => 'H1', @@ -290,7 +290,7 @@ private function add_style_zigzags_section() { 'tab' => Controls_Manager::TAB_STYLE, ] ); - + $this->add_control( 'image_label', [ @@ -326,22 +326,22 @@ private function add_style_zigzags_section() { $this->add_responsive_control( 'image_position', [ - 'label' => esc_html__( 'Position', 'elementor' ), + 'label' => esc_html__( 'Position', 'hello-plus' ), 'type' => Controls_Manager::SELECT, 'desktop_default' => 'center center', 'tablet_default' => 'center center', 'mobile_default' => 'center center', 'options' => [ - '' => esc_html__( 'Default', 'elementor' ), - 'center center' => esc_html__( 'Center Center', 'elementor' ), - 'center left' => esc_html__( 'Center Left', 'elementor' ), - 'center right' => esc_html__( 'Center Right', 'elementor' ), - 'top center' => esc_html__( 'Top Center', 'elementor' ), - 'top left' => esc_html__( 'Top Left', 'elementor' ), - 'top right' => esc_html__( 'Top Right', 'elementor' ), - 'bottom center' => esc_html__( 'Bottom Center', 'elementor' ), - 'bottom left' => esc_html__( 'Bottom Left', 'elementor' ), - 'bottom right' => esc_html__( 'Bottom Right', 'elementor' ), + '' => esc_html__( 'Default', 'hello-plus' ), + 'center center' => esc_html__( 'Center Center', 'hello-plus' ), + 'center left' => esc_html__( 'Center Left', 'hello-plus' ), + 'center right' => esc_html__( 'Center Right', 'hello-plus' ), + 'top center' => esc_html__( 'Top Center', 'hello-plus' ), + 'top left' => esc_html__( 'Top Left', 'hello-plus' ), + 'top right' => esc_html__( 'Top Right', 'hello-plus' ), + 'bottom center' => esc_html__( 'Bottom Center', 'hello-plus' ), + 'bottom left' => esc_html__( 'Bottom Left', 'hello-plus' ), + 'bottom right' => esc_html__( 'Bottom Right', 'hello-plus' ), ], 'selectors' => [ '{{WRAPPER}} .e-zigzag' => '--zigzag-image-position: {{VALUE}}', @@ -536,12 +536,12 @@ private function add_style_zigzags_section() { $this->add_control( 'button_type', [ - 'label' => esc_html__( 'Type', 'elementor' ), + 'label' => esc_html__( 'Type', 'hello-plus' ), 'type' => Controls_Manager::SELECT, 'default' => 'link', 'options' => [ - 'button' => esc_html__( 'Button', 'elementor' ), - 'link' => esc_html__( 'Link', 'elementor' ), + 'button' => esc_html__( 'Button', 'hello-plus' ), + 'link' => esc_html__( 'Link', 'hello-plus' ), ], ] ); @@ -553,7 +553,7 @@ private function add_style_zigzags_section() { 'selector' => '{{WRAPPER}} .e-zigzag__button', 'fields_options' => [ 'typography' => [ 'default' => 'yes' ], - ] + ], ] ); @@ -637,7 +637,7 @@ private function add_style_zigzags_section() { [ 'name' => 'button_background', 'types' => [ 'classic', 'gradient' ], - 'exclude' => ['image'], + 'exclude' => [ 'image' ], 'selector' => '{{WRAPPER}} .e-zigzag__button', 'fields_options' => [ 'background' => [ @@ -760,14 +760,14 @@ private function add_style_zigzags_section() { $this->add_control( 'button_shape', [ - 'label' => esc_html__( 'Shape', 'elementor' ), + 'label' => esc_html__( 'Shape', 'hello-plus' ), 'type' => Controls_Manager::SELECT, 'default' => 'default', 'options' => [ - 'default' => esc_html__( 'Default', 'elementor' ), - 'sharp' => esc_html__( 'Sharp', 'elementor' ), - 'round' => esc_html__( 'Round', 'elementor' ), - 'rounded' => esc_html__( 'Rounded', 'elementor' ), + 'default' => esc_html__( 'Default', 'hello-plus' ), + 'sharp' => esc_html__( 'Sharp', 'hello-plus' ), + 'round' => esc_html__( 'Round', 'hello-plus' ), + 'rounded' => esc_html__( 'Rounded', 'hello-plus' ), ], 'condition' => [ 'button_type' => 'button', @@ -789,7 +789,7 @@ private function add_style_zigzags_section() { $this->add_responsive_control( 'button_padding', [ - 'label' => esc_html__( 'Padding', 'elementor' ), + 'label' => esc_html__( 'Padding', 'hello-plus' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'selectors' => [ @@ -848,7 +848,7 @@ private function add_style_zigzags_section() { $this->end_controls_section(); } - private function add_box_style_section( ) { + private function add_box_style_section() { $this->start_controls_section( 'box_style_section', [ @@ -870,7 +870,7 @@ private function add_box_style_section( ) { [ 'name' => 'background', 'types' => [ 'classic', 'gradient' ], - 'exclude' => ['image'], + 'exclude' => [ 'image' ], 'selector' => '{{WRAPPER}} .e-zigzag__item-wrapper', ] @@ -893,7 +893,7 @@ private function add_box_style_section( ) { [ 'name' => 'alternate_background', 'types' => [ 'classic', 'gradient' ], - 'exclude' => ['image'], + 'exclude' => [ 'image' ], 'condition' => [ 'show_alternate_background' => 'yes', ],