Closed Khadreal closed 10 months ago
@Tabrisrp This PR is dependent on this: https://github.com/wp-media/imagify-plugin/pull/782 no?
@Tabrisrp This PR is dependent on this: #782 no?
To the best of my knowledge, no
This is how I was picturing it so that we can re-use the function whenever we need:
function imagify_nextgen_images_formats() { $formats = [ 'webp', ]; if ( get_imagify_option( 'convert_to_avif' ) ) { $formats[] = 'avif'; } $default = $formats; /** * Filters the array of next gen formats to generate with Imagify * * @since 2.2 * * @param array $formats Array of image formats */ $formats = apply_filters( 'imagify_nextgen_images_formats', $formats ); if ( ! is_array( $formats ) ) { $formats = $default; } return $formats; }
Cool! I was thinking we would use filter in place of calling the function.
Description
Add
imagify_nextgen_images_formats
filterFixes #777
Type of change
Is the solution different from the one proposed during the grooming?
No
Checklists
Generic development checklist
Test summary