label ], value, locked_by? }, * where `locked_by` names a checklist field that disables this * one while it has any option checked; * `checklist` : { name, label, panel?, options: [ value => label ], * value: [ checked ], min_unchecked?, max_checked? }, one array * setting whose caps disable the unchecked options once reached; * `checkboxes`: { label?, panel?, options: [ key => label ], * value: [ key => bool ] }, independent booleans. * @var string $widget_id Owning widget identifier. * @var bool $can_reset Whether the widget is off its defaults, i.e. there is something to reset. */ if ( ! defined( 'ABSPATH' ) ) { exit; } /* * Build an `id`, `class`, `data-*` and generic-attribute string, escaped piece by piece. */ $build_attrs = static function ( string $id, array $classes, array $data = [], array $attrs = [] ): string { $html = $id !== '' ? 'id="' . esc_attr( $id ) . '" ' : ''; $html .= 'class="' . esc_attr( implode( ' ', array_filter( array_map( 'sanitize_html_class', $classes ) ) ) ) . '"'; foreach ( $data as $name => $value ) { $html .= ' data-' . esc_attr( $name ) . '="' . esc_attr( $value ) . '"'; } foreach ( $attrs as $name => $value ) { $html .= ' ' . esc_attr( $name ) . '="' . esc_attr( $value ) . '"'; } return $html; }; ?>