• Resolved mmikolas

    (@mmikolas)


    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 1 month, 1 week ago by mmikolas.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.