WC_Admin_Log_Table_List::column_level()publicWC 1.0

Level column.

Method of the class: WC_Admin_Log_Table_List{}

No Hooks.

Return

String.

Usage

$WC_Admin_Log_Table_List = new WC_Admin_Log_Table_List();
$WC_Admin_Log_Table_List->column_level( $log );
$log(array) (required)
-

WC_Admin_Log_Table_List::column_level() code WC 8.9.0

public function column_level( $log ) {
	$level_key = WC_Log_Levels::get_severity_level( $log['level'] );
	$levels    = WC_Log_Levels::get_all_level_labels();

	if ( ! isset( $levels[ $level_key ] ) ) {
		return '';
	}

	$level       = $levels[ $level_key ];
	$level_class = sanitize_html_class( 'log-level--' . $level_key );
	return '<span class="log-level ' . $level_class . '">' . esc_html( $level ) . '</span>';
}