I want to get recent posts and I use wp_get_recent_posts :
<?php $args = array(
'numberposts' => '3',
'post_status' => 'publish',
'orderby' => 'rand'
);
$recent_posts = wp_get_recent_posts($args);?>
then I want to show posts info on page:
<?php foreach( $recent_posts as $recent ){?>
<li>
<?php echo the_category('/','',$recent["ID"]); ?>
<?php echo get_permalink($recent["ID"]) ?>
<?php echo $recent["post_title"]?></h2>
<?php echo get_the_date('F j, Y',$recent["ID"])?>
<?php echo get_the_post_thumbnail($recent["ID"],'bereza-carousel');?>
</li>
<?php
}?>
But all dynamic data must be correctly escaped. So how can I correctly escape data?