auto-patch 638-dev-dev01-2024-05-14T20_44_36
This commit is contained in:
@@ -112,10 +112,10 @@ abstract class AbstractBulk implements BulkInterface {
|
||||
* @return int The number of media.
|
||||
*/
|
||||
public function has_optimized_media_without_nextgen() {
|
||||
$format = 'webp';
|
||||
$format = get_imagify_option( 'optimization_format' );
|
||||
|
||||
if ( get_imagify_option( 'convert_to_avif' ) ) {
|
||||
$format = 'avif';
|
||||
if ( 'off' === $format ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return count( $this->get_optimized_media_ids_without_format( $format )['ids'] );
|
||||
|
||||
@@ -586,11 +586,20 @@ class Bulk {
|
||||
* @return void
|
||||
*/
|
||||
public function maybe_generate_missing_nextgen( $old_value, $value ) {
|
||||
if ( empty( $old_value['convert_to_avif'] ) === empty( $value['convert_to_avif'] ) ) {
|
||||
if ( ! isset( $old_value['optimization_format'], $value['optimization_format'] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $old_value['optimization_format'] === $value['optimization_format'] ) {
|
||||
// Old value = new value so do nothing.
|
||||
return;
|
||||
}
|
||||
|
||||
if ( 'off' === $value['optimization_format'] ) {
|
||||
// No need to generate next-gen images.
|
||||
return;
|
||||
}
|
||||
|
||||
$contexts = $this->get_contexts();
|
||||
$formats = imagify_nextgen_images_formats();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user