Displayed HTML in table does not work

[ad_1]

Hey,

Some of my data contains an HTML element in the form of a link, but it is not displayed on the frontend. Is there a way to display this data?

I am using a shortcode to display data from a table.

function shortcode_oteviraci_doba() {
$table = get_field('zkusebna');

if (!empty($table)) {
$output=”<table border=”0″>”;

if (!empty($table[‘caption’])) {
$output .= ‘<caption>’ . esc_html($table[‘caption’]) . ‘</caption>’;
}

if (!empty($table[‘header’])) {
$output .= ‘<thead><tr>’;
foreach ($table[‘header’] as $th) {
$output .= ‘<th>’ . esc_html($th[‘c’]) . ‘</th>’;
}
$output .= ‘</tr></thead>’;
}

$output .= ‘<tbody>’;
foreach ($table[‘body’] as $tr) {
$output .= ‘<tr>’;
foreach ($tr as $td) {
$output .= ‘<td>’ . esc_html($td[‘c’]) . ‘</td>’;
}
$output .= ‘</tr>’;
}
$output .= ‘</tbody></table>’;

return $output;
}

return ‘<p>No data available.</p>’;
}

add_shortcode(‘oteviraci_doba’, ‘shortcode_oteviraci_doba’);

  • This topic was modified 12 hours, 20 minutes ago by mmikolas.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer