function display_custom_form_data_shortcode($atts) { ob_start(); if (!isset($_GET['entry_id'])) { echo "Entry ID not specified."; return ob_get_clean(); } global $wpdb; $entry_id = intval($_GET['entry_id']); $table_entries = $wpdb->prefix . 'frm_items'; $table_entry_meta = $wpdb->prefix . 'frm_item_metas'; $entry = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_entries WHERE id = %d", $entry_id)); if (!$entry) { echo "No entry found for this ID."; return ob_get_clean(); } $meta_data = $wpdb->get_results($wpdb->prepare( "SELECT meta_key, meta_value FROM $table_entry_meta WHERE item_id = %d ORDER BY field_order ASC", $entry_id )); echo "
Field | Value |
---|---|
" . esc_html($label) . " | " . $value . " |
" . esc_html($dec[0]) . " | " . $dec[1] . " |