humanmade / humanmade/tachyon-plugin
URL args get dropped when URL is already a Tachyon URL
- Dominant language
- PHP
- Stars
- 86
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
Environment: Altis v3 / Tachyon plugin 0.11.1
I have a custom field on the user profile managed by CMB2 - it's a file upload field
```
$cmb->add_field( [
'name' => esc_html__( 'Author Portrait', 'dormakaba' ),
'id' => 'dormakaba-author-portrait',
'type' => 'file',
'on_front' => false,
] );
```
On opening the media modal to select the image, the image URL is like `https://example.com/tachyon/2020/09/3.jpg`
Then we output the image with a `resize` parameter
`$resized_url = tachyon_url( $attachment_url, [ 'resize' => '90,90' ] );`
However the `tachyon_url` function has a conditional check
```
if ( strpos( $image_url, $upload_baseurl ) !== 0 ) {
return $image_url;
}
```
which means that it will not add the query parameters.
The workaround is to use the attachment ID which is also stored by CMB2 `wp_get_attachment_image_url( $attachment_id, 'dk-hero-portrait-image' );`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.