Automattic\WooCommerce\Internal\Admin\Settings

Utils::trim_php_file_extensionpublic staticWC 1.0

Trim the .php file extension from a path.

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

Хуков нет.

Возвращает

Строку. The trimmed path. If the path does not end with .php, it will be returned as is.

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

$result = Utils::trim_php_file_extension( $path ): string;
$path(строка) (обязательный)
The path to trim.

Код Utils::trim_php_file_extension() WC 11.0.1

public static function trim_php_file_extension( string $path ): string {
	if ( ! empty( $path ) && str_ends_with( $path, '.php' ) ) {
		$path = substr( $path, 0, - 4 );
	}

	return $path;
}