function __construct($id = '', $output = 'OBJECT') { $this->id = $id; $this->output = $output; $this->details = get_post($this->id, $this->output); $discounts = new TC_Discounts(); $fields = $discounts->get_discount_fields(); foreach ($fields as $field) { if (!isset($this->details->{$field['field_name']})) { $this->details->{$field['field_name']} = get_post_meta($this->id, $field['field_name'], true); } } }
$message = __('You do not have required permissions for this action.', 'tc'); } } } if (isset($_GET['page_num'])) { $page_num = (int) $_GET['page_num']; } else { $page_num = 1; } if (isset($_GET['s'])) { $discountssearch = $_GET['s']; } else { $discountssearch = ''; } $wp_discounts_search = new TC_Discounts_Search($discountssearch, $page_num); $fields = $discounts->get_discount_fields(); $columns = $discounts->get_columns(); ?> <div class="wrap tc_wrap"> <h2><?php echo $discounts->form_title; if (isset($_GET['action']) && $_GET['action'] == 'edit') { ?> <a href="edit.php?post_type=tc_events&page=<?php echo $_GET['page']; ?> " class="add-new-h2"><?php _e('Add New', 'tc'); ?> </a><?php }