Tidy search.php: escape output, fix heading printf

This commit is contained in:
ai-bot committed 2026-10-14 09:05:29 +00:00
1 parent 5d069ec1aa
commit 8b93ca0602
1 file changed
+24 -23
+24 -23
View File
@@ -1,23 +1,24 @@
<?php
get_header();
printf("<h2 class=\"entry-title search\">" . esc_html__("Søk: %s", "textdomain"), get_search_query() . "</h2>");
if (have_posts()) :
while (have_posts()) : the_post();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<div class="entry-content">
<?php the_content(); ?>
</div>
</article>
<?php
endwhile;
endif;
get_footer();
?>
<?php
get_header();
printf(
'<h2 class="entry-title search">%s</h2>',
esc_html(sprintf(__("Søk: %s", "super-simple-wp-theme"), get_search_query()))
);
if (have_posts()) :
while (have_posts()) : the_post();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<div class="entry-content">
<?php the_content(); ?>
</div>
</article>
<?php
endwhile;
endif;
get_footer();