$is_primary =
$primary ===
$column_name;
$classes = "{
$column_name} column-{
$column_name}";
if ( $is_primary ) { $classes .= ' has-row-actions column-primary';
} if ( in_array( $column_name,
$hidden, true
) ) { $classes .= ' hidden';
} printf( '<td class="%s" data-colname="%s">',
esc_attr( $classes ),
esc_attr( wp_strip_all_tags( $display_name ) ) );
switch ( $column_name ) { case 'name':
echo '{{ data.name }}';
break;
case 'created':
// JSON encoding automatically doubles backslashes to ensure they don't get lost when printing the inline JS.
echo '<# print( wp.date.dateI18n( ' .
wp_json_encode( __( 'F j, Y'
) ) . ', data.created ) ) #>';
break;
case 'last_used':
echo '<# print( data.last_used !== null ? wp.date.dateI18n( ' .
wp_json_encode( __( 'F j, Y'
) ) . ", data.last_used ) : '—' ) #>";