Automattic\WooCommerce\Internal\Admin\Settings
Utils::trim_php_file_extension
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() 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;
}