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.


Retrieve the HTML for the codes area.

Return Return


Top ↑

Source Source

File: includes/admin/post-types/meta-boxes/

	private function codes_section_html() {

		global $post;
		$voucher     = new LLMS_Voucher( $post->ID );
		$codes       = $voucher->get_voucher_codes();
		$delete_icon = '<span class="dashicons dashicons-no"></span><span class="screen-reader-text">' . __( 'Delete', 'lifterlms' ) . '</span>';

		ob_start(); ?>
		<div class="llms-voucher-codes-wrapper" id="llms-form-wrapper">


				<script>var delete_icon = '<?php echo $delete_icon; ?>';</script>

				<tbody id="llms_voucher_tbody">
				if ( ! empty( $codes ) ) :
					foreach ( $codes as $code ) :
								<input type="text" maxlength="20" placeholder="Code" value="<?php echo $code->code; ?>"
								<input type="hidden" name="llms_voucher_code_id[]" value="<?php echo $code->id; ?>">
							<td><span><?php echo $code->used; ?> / </span><input type="number" min="1" value="<?php echo $code->redemption_count; ?>"
														placeholder="Uses" class="llms-voucher-uses"
								<a href="#" data-id="<?php echo $code->id; ?>" class="llms-voucher-delete">
									<?php echo $delete_icon; ?>


			<div class="llms-voucher-add-codes">
				<p>Add <input type="number" max="50" placeholder="#" id="llms_voucher_add_quantity"> new code(s) with <input
						type="number" placeholder="#" id="llms_voucher_add_uses"> use(s) per code
					<button id="llms_voucher_add_codes" class="button-primary">Add</button>

			<input type="hidden" name="delete_ids" id="delete_ids">

		return ob_get_clean();

Top ↑

Changelog Changelog

Version Description
4.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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