false, 'lead_hours' => 24, 'revision' => 1, 'subject' => __( 'Reminder: your booking with {business_name}', 'abientot' ), 'body' => __( '
Hello {customer_name},
This is a reminder of your booking.
Service: {service_name}
When: {start}
Location: {location_name}
Staff: {staff_name}
{business_name}
', 'abientot' ), ); } /** * @param mixed $value Stored or submitted settings. */ public static function normalize( $value ): array { $defaults = self::defaults(); if ( ! is_array( $value ) ) { return $defaults; } $out = $defaults; $out['enabled'] = ( $value['enabled'] ?? false ) === true; if ( isset( $value['lead_hours'] ) && is_numeric( $value['lead_hours'] ) ) { $out['lead_hours'] = max( 1, min( 168, (int) $value['lead_hours'] ) ); } $out['revision'] = isset( $value['revision'] ) && is_numeric( $value['revision'] ) ? max( 1, (int) $value['revision'] ) : 1; foreach ( array( 'subject', 'body' ) as $key ) { if ( isset( $value[ $key ] ) && is_string( $value[ $key ] ) && trim( $value[ $key ] ) !== '' ) { $out[ $key ] = $key === 'subject' ? sanitize_text_field( $value[ $key ] ) : wp_kses_post( $value[ $key ] ); } } return $out; } }