芝麻web文件管理V1.00
编辑当前文件:/home/ezdajrnh/public_html/wp-content/plugins/google-listings-and-ads/src/Options/AccountState.php
options->get( $this->option_name(), [] ); if ( empty( $state ) && $initialize_if_not_found ) { $state = []; foreach ( $this->account_creation_steps() as $step ) { $state[ $step ] = [ 'status' => self::STEP_PENDING, 'message' => '', 'data' => [], ]; } $this->update( $state ); } return $state; } /** * Update the account state option. * * @param array $state */ public function update( array $state ) { $this->options->update( $this->option_name(), $state ); } /** * Mark a step as completed. * * @param string $step Name of the completed step. */ public function complete_step( string $step ) { $state = $this->get( false ); if ( isset( $state[ $step ] ) ) { $state[ $step ]['status'] = self::STEP_DONE; $this->update( $state ); } } /** * Returns the name of the last incompleted step. * * @return string */ public function last_incomplete_step(): string { $incomplete = ''; foreach ( $this->get( false ) as $name => $step ) { if ( ! isset( $step['status'] ) || self::STEP_DONE !== $step['status'] ) { $incomplete = $name; break; } } return $incomplete; } /** * Returns any data from a specific step. * * @param string $step Step name. * @return array */ public function get_step_data( string $step ): array { return $this->get( false )[ $step ]['data'] ?? []; } }