'', 'close' => '' ) : array( 'open' => $open, 'close' => $close ); } $closures = array(); foreach ( preg_split( '/[\s,]+/', sanitize_textarea_field( wp_unslash( $_POST['sofrah_board_closures'] ?? '' ) ) ) as $date ) { if ( preg_match( '/^\d{4}-\d{2}-\d{2}$/', $date ) ) { $closures[] = $date; } } update_option( 'sofrah_board_venue', array( 'address' => sanitize_textarea_field( wp_unslash( $_POST['sofrah_board_address'] ?? '' ) ), 'phone' => sanitize_text_field( wp_unslash( $_POST['sofrah_board_phone'] ?? '' ) ), 'hours' => $hours, 'last_order' => min( 180, absint( $_POST['sofrah_board_last_order'] ?? 30 ) ), 'closures' => array_values( array_unique( $closures ) ), 'paused' => ! empty( $_POST['sofrah_board_paused'] ), ) ); return __( 'Venue and opening hours saved.', 'sofrah-order-board' ); } /** * The venue form. */ function sofrah_board_venue_settings_form() { $v = sofrah_board_venue(); $names = array( __( 'Sunday', 'sofrah-order-board' ), __( 'Monday', 'sofrah-order-board' ), __( 'Tuesday', 'sofrah-order-board' ), __( 'Wednesday', 'sofrah-order-board' ), __( 'Thursday', 'sofrah-order-board' ), __( 'Friday', 'sofrah-order-board' ), __( 'Saturday', 'sofrah-order-board' ) ); $start = (int) get_option( 'start_of_week', 1 ); ?>

payment_gateways()->get_available_payment_gateways() : array(); $pickup = array_intersect( array_keys( $methods ), (array) $s['methods'] ); $tested = (bool) wc_get_orders( array( 'limit' => 1, 'return' => 'ids', 'meta_key' => '_sofrah_board_status', 'meta_compare' => 'EXISTS' ) ); // phpcs:ignore WordPress.DB.SlowDBQuery $rows = array( array( (bool) $pickup, __( 'A pay-at-pickup payment method is switched on and ticked below', 'sofrah-order-board' ), admin_url( 'admin.php?page=wc-settings&tab=checkout' ) ), array( '' !== trim( $v['address'] ) && '' !== trim( $v['phone'] ), __( 'Your address and phone number are set', 'sofrah-order-board' ), '#venue' ), array( sofrah_board_venue_configured(), __( 'Your opening hours are saved', 'sofrah-order-board' ), '#venue' ), array( (bool) wc_get_products( array( 'limit' => 1, 'status' => 'publish', 'return' => 'ids' ) ), __( 'Your menu has at least one dish', 'sofrah-order-board' ), admin_url( 'post-new.php?post_type=product' ) ), array( $tested, __( 'A test order has been placed and handled on the order board', 'sofrah-order-board' ), admin_url( 'admin.php?page=sob-board' ) ), ); $done = count( array_filter( array_column( $rows, 0 ) ) ); ?>