Resolver
Resolves sidecars by URL with request and object caching.
File existence is authoritative because unusable sidecars are deleted.
Namespace: WebberZone\Image_Optimizer\Frontend
Since: 1.0.0
Source: includes/frontend/class-resolver.php line 23
Methods
resolve() static
Resolve a source image URL to its sidecar URL.
Since: 1.0.0
Line: 66
static public function resolve( string $url, string $format ): string;
| Type | Name | Description |
|---|---|---|
string |
$url |
Source image URL. |
string |
$format |
Target format slug. |
Returns: string — Sidecar URL, or an empty string when there is none.
is_local() static
Whether the URL points at a file inside this site’s uploads directory.
Since: 1.0.0
Line: 113
static public function is_local( string $url ): bool;
| Type | Name | Description |
|---|---|---|
string |
$url |
Image URL. |
Returns: bool — True when the URL is local.
flush_memo() static
Forget everything cached for the current request.
Since: 1.0.0
Line: 124
static public function flush_memo( ): void;
Returns: void
invalidate_path() static
Invalidate cached existence after sidecar creation or deletion.
Since: 1.0.0
Line: 136
static public function invalidate_path( string $path ): void;
| Type | Name | Description |
|---|---|---|
string |
$path |
Absolute source image path. |
Returns: void