Untitled
unknown
plain_text
10 months ago
1.1 kB
20
Indexable
add_action('salesking_customers_custom_columns_header', 'add_customer_status_column_header');
function add_customer_status_column_header() {
?>
<th class="nk-tb-col tb-col-md"><span class="sub-text"><?php esc_html_e('Status','salesking'); ?></span></th>
<?php
}
add_action('salesking_customers_custom_columns_content', 'add_customer_status_column_content');
function add_customer_status_column_content($customerobj) {
$customer_id = $customerobj->get_id();
$approval_status = get_user_meta($customer_id, 'b2bking_account_approved', true);
if ($approval_status === 'no') {
$status_text = esc_html__('Not Approved', 'salesking');
$status_class = 'text-danger'; // Red text for not approved
} else {
$status_text = esc_html__('Approved', 'salesking');
$status_class = 'text-success'; // Green text for approved
}
?>
<td class="nk-tb-col tb-col-md">
<div>
<span class="<?php echo esc_attr($status_class); ?>"><?php echo $status_text; ?></span>
</div>
</td>
<?php
}Editor is loading...
Leave a Comment