true to hide the row instead of greying it out). * @param callable|null $sanitize Custom sanitizer `function( $value, Field $field ): mixed`. Falls back to a sane default per type. * @param Doc|null $doc Documentation panel content. * @param int $priority Ordering within its section. */ public function __construct( public readonly string $id, public readonly string $label, public readonly string $type = 'checkbox', // phpcs:ignore Universal.NamingConventions.NoReservedKeywordParameterNames.defaultFound -- `default` is the clearest name for this concept (matches common convention, e.g. dict.get(key, default)); used as a named argument and public property throughout the codebase. public readonly mixed $default = '', public readonly array $args = array(), ?callable $sanitize = null, public readonly ?Doc $doc = null, public readonly int $priority = 10 ) { $this->sanitize_cb = $sanitize; } /** * Sanitize a raw submitted/imported value for this field. * * @param mixed $value Raw value. * @return mixed */ public function sanitize( mixed $value ): mixed { if ( null !== $this->sanitize_cb ) { return ( $this->sanitize_cb )( $value, $this ); } return FieldRenderer::default_sanitize( $this->type, $value, $this->args ); } }