Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Meta_Box_Voucher::redemption_section_html()

Retrieve the HTML for the redemption area.


Return Return

(string)


Top ↑

Source Source

File: includes/admin/post-types/meta-boxes/class.llms.meta.box.voucher.php

	 * @return string
	 */
	private function redemption_section_html() {

		global $post;

		$pid            = $post->ID;
		$voucher        = new LLMS_Voucher( $pid );
		$redeemed_codes = $voucher->get_redeemed_codes();
		ob_start();
		?>

		<div class="llms-voucher-redemption-wrapper">
			<table>

				<thead>
				<tr>
					<th>Name</th>
					<th>Email</th>
					<th>Redemption Date</th>
					<th>Code</th>
				</tr>
				</thead>

				<tbody>
				<?php
				if ( ! empty( $redeemed_codes ) ) :
					foreach ( $redeemed_codes as $redeemed_code ) :

						$user = get_user_by( 'id', $redeemed_code->user_id );
						?>
						<tr>
							<td><?php echo esc_html( $user->data->display_name ); ?></td>
							<td><?php echo esc_html( $user->data->user_email ); ?></td>
							<td><?php echo esc_html( $redeemed_code->redemption_date ); ?></td>
							<td><?php echo esc_html( $redeemed_code->code ); ?></td>
						</tr>
						<?php
					endforeach;
				endif;
				?>
				</tbody>

			</table>
		</div>

		<?php


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.