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

198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
* @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.