DatabaseUtil::parse_dbdelta_output()publicWC 1.0

Parses the output given by dbdelta and returns information about it.

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

Хуков нет.


Массив[]. An array containing a 'created_tables' key whose value is an array with the names of the tables that have been (or would have been) created.


$DatabaseUtil = new DatabaseUtil();
$DatabaseUtil->parse_dbdelta_output( $dbdelta_output ): array;
$dbdelta_output(массив) (обязательный)
The output from the execution of dbdelta.

Код DatabaseUtil::parse_dbdelta_output() WC 7.3.0

public function parse_dbdelta_output( array $dbdelta_output ): array {
	$created_tables = array();

	foreach ( $dbdelta_output as $table_name => $result ) {
		if ( "Created table $table_name" === $result ) {
			$created_tables[] = $table_name;

	return array( 'created_tables' => $created_tables );