Automattic\WooCommerce\Internal\Logging

RemoteLogger::normalize_paths()privateWC 1.0

Normalize file paths by replacing absolute paths with relative ones.

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

Хуков нет.

Возвращает

Строку. The content with normalized paths.

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

// private - только в коде основоного (родительского) класса
$result = $this->normalize_paths( $content ): string;
$content(строка) (обязательный)
The content containing paths to normalize.

Код RemoteLogger::normalize_paths() WC 9.7.1

private function normalize_paths( string $content ): string {
	$plugin_path = StringUtil::normalize_local_path_slashes( trailingslashit( dirname( WC_ABSPATH ) ) );
	$wp_path     = StringUtil::normalize_local_path_slashes( trailingslashit( ABSPATH ) );

	return str_replace(
		array( $plugin_path, $wp_path ),
		array( './', './' ),
		$content
	);
}