WordPress at Your Fingertips
function is not described


Path_Processor::get_real_path() private WC 1.0

Given a path this will figure out the real path that we should be using.

{} It's a method of the class: Path_Processor{}

No Hooks.


String. The resolved path.


// private - for code of main (parent) class only
$result = $this->get_real_path( $path );
$path(string) (required)
The path to resolve.

Code of Path_Processor::get_real_path() WC 5.5.2

private function get_real_path( $path ) {
	// We want to resolve symbolic links for consistency with __DIR__ paths.
	// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
	$real_path = @realpath( $path );
	if ( false === $real_path ) {
		// Let the autoloader deal with paths that don't exist.
		$real_path = $path;

	// Using realpath will make it platform-specific so we must normalize it after.
	if ( $path !== $real_path ) {
		$real_path = wp_normalize_path( $real_path );

	return $real_path;