ActionScheduler_Abstract_Schema::schema_update_required()privateWC 1.0

Determine if the database schema is out of date by comparing the integer found in $this->schema_version with the option set in the WordPress options table

Метод класса: ActionScheduler_Abstract_Schema{}

Хуков нет.

Возвращает

true|false.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->schema_update_required();

Код ActionScheduler_Abstract_Schema::schema_update_required() WC 8.7.0

private function schema_update_required() {
	$option_name      = 'schema-' . static::class;
	$this->db_version = get_option( $option_name, 0 );

	// Check for schema option stored by the Action Scheduler Custom Tables plugin in case site has migrated from that plugin with an older schema
	if ( 0 === $this->db_version ) {

		$plugin_option_name = 'schema-';

		switch ( static::class ) {
			case 'ActionScheduler_StoreSchema':
				$plugin_option_name .= 'Action_Scheduler\Custom_Tables\DB_Store_Table_Maker';
				break;
			case 'ActionScheduler_LoggerSchema':
				$plugin_option_name .= 'Action_Scheduler\Custom_Tables\DB_Logger_Table_Maker';
				break;
		}

		$this->db_version = get_option( $plugin_option_name, 0 );

		delete_option( $plugin_option_name );
	}

	return version_compare( $this->db_version, $this->schema_version, '<' );
}