Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions inc/list-tables/class-checkout-form-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,27 @@ public function column_slug($item) {
return "<span class='wu-bg-gray-200 wu-text-gray-700 wu-py-1 wu-px-2 wu-rounded-sm wu-text-xs wu-font-mono'>{$slug}</span>";
}

/**
* Displays the active status of the form.
*
* @since 2.0.21
*
* @param \WP_Ultimo\Models\Checkout_Form $item Checkout Form object.
* @return string
*/
public function column_active($item) {

if ($item->is_active()) {
$label = __('Active', 'ultimate-multisite');
$class = 'wu-bg-green-200 wu-text-green-700';
} else {
$label = __('Inactive', 'ultimate-multisite');
$class = 'wu-bg-red-200 wu-text-red-700';
}

return "<span class='wu-py-1 wu-px-2 wu-rounded-sm wu-text-xs wu-font-mono {$class}'>{$label}</span>";
}

/**
* Displays the number pof steps and fields.
*
Expand Down Expand Up @@ -194,11 +215,12 @@ public function process_single_action(): void {
public function get_columns() {

$columns = [
'cb' => '<input type="checkbox" />',
'name' => __('Form Name', 'ultimate-multisite'),
'slug' => __('Form Slug', 'ultimate-multisite'),
'steps' => __('Steps', 'ultimate-multisite'),
'id' => __('ID', 'ultimate-multisite'),
'cb' => '<input type="checkbox" />',
'name' => __('Form Name', 'ultimate-multisite'),
'active' => __('Status', 'ultimate-multisite'),
'slug' => __('Form Slug', 'ultimate-multisite'),
'steps' => __('Steps', 'ultimate-multisite'),
'id' => __('ID', 'ultimate-multisite'),
];

return $columns;
Expand Down
Loading