We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
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' ] );
resize
$resized_url = tachyon_url( $attachment_url, [ 'resize' => '90,90' ] );
However the tachyon_url function has a conditional check
tachyon_url
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' );
wp_get_attachment_image_url( $attachment_id, 'dk-hero-portrait-image' );
The text was updated successfully, but these errors were encountered:
The workaround won't work when attempting to retrieve an attachment that belongs to another site unless we switch_to_blog
switch_to_blog
Sorry, something went wrong.
No branches or pull requests
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
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 checkwhich 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' );
The text was updated successfully, but these errors were encountered: