/** * Conditionally displays a message if the $post_id is 2 * * @param array $field_args Array of field parameters * @param CMB2_Field object $field Field object */ public function transaction_details($field, $escaped_value, $object_id, $object_type, $field_type_object) { $donation = new Donation($object_id); $details = '<table class="form-table">'; foreach ($donation->getTransaction() as $k => $v) { $k = ucfirst(str_replace('_', ' ', $k)); $v = urldecode($v); $details .= "<tr><td class=\"row-title\">{$k}</td>"; $details .= "<td><em>{$v}</em></td></tr>"; } $details .= '</table>'; echo $details; }