WordPress\AiClient\Providers\ApiBasedImplementation
AbstractApiProvider::url
Constructs a full URL by combining the base URL with an optional path.
This method ensures proper URL construction by:
- Using the provider's base URL
- Trimming leading slashes from the path to prevent double-slashes
- Joining the base URL and path with a single forward slash
Метод класса: AbstractApiProvider{}
Хуков нет.
Возвращает
string. The complete URL.
Использование
$result = AbstractApiProvider::url( $path ): string;
- $path(строка)
- Optional path to append to the base URL.
По умолчанию:empty string
Список изменений
| С версии 0.2.0 | Введена. |
Код AbstractApiProvider::url() AbstractApiProvider::url WP 7.1.2
public static function url(string $path = ''): string
{
if ($path === '') {
return static::baseUrl();
}
return static::baseUrl() . '/' . ltrim($path, '/');
}