array( 'label', 'description', 'group', 'requires' => array() ) ). */ function dayslot_features() { $free = __( 'Basic', 'dayslot' ); return apply_filters( 'dayslot_features', array( 'times' => array( 'label' => __( 'Time choice', 'dayslot' ), 'description' => __( 'Step "time" at checkout with time windows, exact times and night. Off = customers choose only a date; the price comes from the first row of the price table.', 'dayslot' ), 'group' => $free, ), 'shipping' => array( 'label' => __( 'Delivery price (own shipping method)', 'dayslot' ), 'description' => __( 'The price table becomes the WooCommerce shipping cost. Off = keep your own WooCommerce shipping methods and prices.', 'dayslot' ), 'group' => $free, ), 'calendar' => array( 'label' => __( 'Admin calendar', 'dayslot' ), 'description' => __( 'Month / week / day view of orders with drag & drop and blocking.', 'dayslot' ), 'group' => $free, ), 'ical' => array( 'label' => __( 'Calendar export (.ics)', 'dayslot' ), 'description' => __( 'Private link for Google Calendar, iPhone and Outlook.', 'dayslot' ), 'group' => $free, ), 'placement' => array( 'label' => __( 'Manual placement', 'dayslot' ), 'description' => __( 'Shortcode [dayslot_checkout_field], Gutenberg block and Elementor widget.', 'dayslot' ), 'group' => $free, ), 'order_column' => array( 'label' => __( 'Column in the orders list', 'dayslot' ), 'description' => __( 'Delivery date and time next to each order.', 'dayslot' ), 'group' => $free, ), ) ); } add_filter( 'dayslot_settings_tabs', function ( $tabs ) { $tabs['features'] = array( 'title' => __( 'Modules', 'dayslot' ), 'render' => 'dayslot_render_features_tab', 'sanitize' => function ( $input, $out ) { $on = isset( $input['features'] ) ? array_map( 'sanitize_key', (array) $input['features'] ) : array(); $out['disabled_features'] = array_values( array_diff( array_keys( dayslot_features() ), $on ) ); return $out; }, ); return $tabs; }, 1 ); function dayslot_render_features_tab( $s ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found -- all tab renderers get the settings. $groups = array(); foreach ( dayslot_features() as $id => $f ) { $groups[ $f['group'] ][ $id ] = $f; } ?>

$list ) : ?>

$f ) : ?>