function __construct($id = '', $output = 'OBJECT') { $this->id = $id; $this->output = $output; $this->details = get_post($this->id, $this->output); $templates = new CP_Certificate_Templates(); $fields = $templates->get_template_col_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.', 'cp'); } } } if (isset($_GET['page_num'])) { $page_num = (int) $_GET['page_num']; } else { $page_num = 1; } if (isset($_GET['s'])) { $templatessearch = $_GET['s']; } else { $templatessearch = ''; } $wp_templates_search = new CP_Certificate_Templates_Search($templatessearch, $page_num); $fields = $templates->get_template_col_fields(); $columns = $templates->get_columns(); ?> <div class="wrap cp-wrap certificates-wrap"> <h2><?php _e('Certificate Templates', 'cp'); if (isset($_GET['action']) && ($_GET['action'] == 'edit' || $_GET['action'] == 'add_new')) { ?> <a href="admin.php?page=<?php echo $_GET['page']; ?> " class="add-new-h2"><?php _e('Back', 'cp'); ?> </a><?php } else {