isset( $_GET['updated'] ) ? sanitize_text_field( wp_unslash( $_GET['updated'] ) ) : '', 'error' => isset( $_GET['error'] ) ? sanitize_text_field( wp_unslash( $_GET['error'] ) ) : '', ); // phpcs:enable WordPress.Security.NonceVerification.Recommended $is_edit = ! empty( $attribute->id ); Torlann_Admin::page_header( '', array( 'hide_header' => true ) ); $type_hints = array( 'select' => __('Values will appear as a simple list on the product page.', 'torlann'), 'button' => __('Values will appear as clickable buttons on the product page.', 'torlann'), 'color_swatch' => __('You can assign a color to each value (e.g. "Red") in the management screen — this powers the swatches in product variants.', 'torlann'), ); $current_type = in_array( $attribute->type, array( 'select', 'button', 'color_swatch' ), true ) ? $attribute->type : 'select'; $current_hint = isset( $type_hints[ $current_type ] ) ? $type_hints[ $current_type ] : $type_hints['select']; $add_hint = $type_hints['select']; $list_url = admin_url( 'admin.php?page=torlann-attributes' ); /** Lucide trash-2 — actions ligne. */ $tl_icon_trash = ''; /** Lucide sliders-horizontal — gérer les valeurs. */ $tl_icon_manage = ''; /** Lucide grip-vertical — réordonner. */ $tl_icon_grip = ''; /** * Couleur d’affichage d’une valeur (meta ou suggestion depuis le libellé). * * @param array $term Term row. * @return string Hex #rrggbb. */ $tl_term_color = static function ( $term ) { if ( class_exists( 'Torlann_Variants' ) ) { return Torlann_Variants::resolve_swatch_color( $term ); } $meta_color = ! empty( $term['meta']['color'] ) ? (string) $term['meta']['color'] : ''; if ( $meta_color && preg_match( '/^#[0-9A-Fa-f]{6}$/', $meta_color ) ) { return strtolower( $meta_color ); } return '#cccccc'; }; ?>

label ); ?>

type ) : ?>
type && empty( $term['meta']['color'] ) ); $row_class = 'tl-attributes-term-row' . ( $is_dirty ? ' is-dirty' : '' ); ?>
type ) : ?>

0 ? sprintf( /* translators: %d: product count */ _n('Used on %d product — remove it from your product pages before deleting it', 'Used on %d products — remove it from your product pages before deleting it', $product_count, 'torlann'), $product_count ) : __('Unused — can be removed', 'torlann'); $edit_url = add_query_arg( array( 'page' => 'torlann-attributes', 'edit' => (int) $attr['id'], ), admin_url( 'admin.php' ) ); ?>
0 ) : ?>