Skip to content

Commit

Permalink
Fix some code sniffer problems
Browse files Browse the repository at this point in the history
  • Loading branch information
bordoni committed Oct 11, 2024
1 parent 3800071 commit b8c45b6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 36 deletions.
53 changes: 27 additions & 26 deletions src/Common/Admin/Conditional_Content/Black_Friday.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace TEC\Common\Admin\Conditional_Content;

use TEC\Common\Admin\Settings_Sidebar;
Expand Down Expand Up @@ -65,7 +66,7 @@ protected function should_display(): bool {
protected function get_wide_banner_html(): string {
$template_args = [
'image_src' => tribe_resource_url( 'images/hero-section-wide.jpg', false, null, \Tribe__Main::instance() ),
'link' => 'https://evnt.is/tec-bf-2024',
'link' => 'https://evnt.is/tec-bf-2024',
];

return $this->get_template()->template( 'black-friday', $template_args, false );
Expand All @@ -79,10 +80,10 @@ protected function get_wide_banner_html(): string {
* @return void
*/
public function render_wide_banner_html(): void {
if ( ! $this->should_display() ) {
if ( ! $this->should_display() ) {
return;
}
echo $this->get_wide_banner_html();
echo $this->get_wide_banner_html(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}

/**
Expand All @@ -95,7 +96,7 @@ public function render_wide_banner_html(): void {
protected function get_narrow_banner_html(): string {
$template_args = [
'image_src' => tribe_resource_url( 'images/hero-section-narrow.jpg', false, null, \Tribe__Main::instance() ),
'link' => 'https://evnt.is/tec-bf-2024',
'link' => 'https://evnt.is/tec-bf-2024',
'is_narrow' => true,
];

Expand All @@ -110,14 +111,14 @@ protected function get_narrow_banner_html(): string {
* @return void
*/
public function render_narrow_banner_html(): void {
if ( ! $this->should_display() ) {
if ( ! $this->should_display() ) {
return;
}
echo $this->get_narrow_banner_html();
echo $this->get_narrow_banner_html(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}

public function include_tickets_settings_section(): void {
if ( ! $this->should_display() ) {
if ( ! $this->should_display() ) {
return;
}

Expand Down Expand Up @@ -148,30 +149,30 @@ public function include_sidebar_section( $sidebar ): void {

$sidebar->prepend_section(
( new Settings_Section() )
->add_elements(
[
new Link(
'https://evnt.is/tec-bf-2024',
new Image(
tribe_resource_url( 'images/hero-section-settings-sidebar.jpg', false, null, \Tribe__Main::instance() ),
->add_elements(
[
new Link(
'https://evnt.is/tec-bf-2024',
new Image(
tribe_resource_url( 'images/hero-section-settings-sidebar.jpg', false, null, \Tribe__Main::instance() ),
new Attributes(
[
'alt' => sprintf( esc_attr_x( '%1$s Black Friday Sale for The Events Calendar plugins, add-ons and bundles.', 'Alt text for the Black Friday Ad', 'tribe-common' ), $year ),
'role' => 'presentation',
]
)
),
null,
new Attributes(
[
'alt' => sprintf( esc_attr_x( '%1$s Black Friday Sale for The Events Calendar plugins, add-ons and bundles.', 'Alt text for the Black Friday Ad', 'tribe-common' ), $year ),
'role' => 'presentation',
'title' => sprintf( esc_attr_x( '%1$s Black Friday Sale for The Events Calendar plugins, add-ons and bundles.', 'Alt text for the Black Friday Ad', 'tribe-common' ), $year ),
'target' => '_blank',
'rel' => 'noopener nofollow',
]
)
),
null,
new Attributes(
[
'title' => sprintf( esc_attr_x( '%1$s Black Friday Sale for The Events Calendar plugins, add-ons and bundles.', 'Alt text for the Black Friday Ad', 'tribe-common' ), $year ),
'target' => '_blank',
'rel' => 'noopener nofollow',
]
)
),
]
)
]
)
);
}
}
20 changes: 10 additions & 10 deletions src/Common/Admin/Settings_Sidebar_Section.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,23 @@ protected function render_header_image(): void {
*
* @since TBD
*
* @return void
* @return void
*/
public function render(): void {
?>
<div class="tec-settings-form__sidebar-section tec-settings-form__sidebar-header">
<?php do_action( 'tec_settings_sidebar_header_start' ); ?>
<?php
$this->render_header_image();
$this->render_title();
?>
<?php do_action( 'tec_settings_sidebar_header_end' ); ?>
<?php do_action( 'tec_settings_sidebar_header_start' ); ?>
<?php
$this->render_header_image();
$this->render_title();
?>
<?php do_action( 'tec_settings_sidebar_header_end' ); ?>
</div>
<?php foreach ( $this->sections as $section ) : ?>
<?php foreach ( $this->sections as $section ) : ?>
<div class="tec-settings-form__sidebar-section">
<?php $section->render(); ?>
<?php $section->render(); ?>
</div>
<?php endforeach; ?>
<?php endforeach; ?>
<?php
}
}

0 comments on commit b8c45b6

Please sign in to comment.