step_id = sanitize_key( (string) $step_id ); $this->primary_action_label = sanitize_text_field( (string) $primary_action_label ); $this->is_terminal = (bool) $is_terminal; } /** * Return the configured step identifier. * * @return string Stable step ID. */ public function get_step_id() { return $this->step_id; } /** * Return the configured server-owned action label. * * @param array $checkpoint Unused current checkpoint. * @param array $step_context Unused presentation context. * * @return string Translated action label. */ public function get_primary_action_label( array $checkpoint, array $step_context = array() ) { unset( $checkpoint, $step_context ); return $this->primary_action_label; } /** * Return an explicit non-domain result for checkpoint persistence. * * @param array $validated_fields Validated current-step fields. * @param array $checkpoint Current checkpoint. * @param array $operation_context Stable operation metadata. * * @return array Normalized checkpoint-only result proposal. */ public function save( array $validated_fields, array $checkpoint, array $operation_context ) { unset( $validated_fields, $checkpoint, $operation_context ); return array( 'status' => 'saved', 'summary' => __( 'Setup Wizard progress saved.', 'booking' ), 'canonical_fingerprint' => '', 'created_ids' => array(), 'updated_ids' => array(), 'warnings' => array(), 'writes_canonical_settings' => false, ); } /** * Return whether this handler completes the route. * * @return bool True for the final checkpoint-only handler. */ public function is_terminal() { return $this->is_terminal; } }