prevent_auto_optimization_when_generating_thumbnails() * * @param array $metadata An array of attachment meta data. * @param int $attachment_id Current attachment ID. * @param string $context Additional context. Can be 'create' when metadata was initially created for new attachment or 'update' when the metadata was updated. * @return array An array of attachment meta data. */ public function allow_auto_optimization_when_generating_thumbnails( $metadata, $attachment_id, $context = null ) { _deprecated_function( get_class( $this ) . '::' . __FUNCTION__ . '()', '1.9.10' ); if ( ! empty( $context ) && 'create' !== $context ) { return $metadata; } // Fired from wp_generate_attachment_metadata(): $context is empty (WP < 5.3) or equal to 'create' (>P >= 5.3). static::allow_optimization_internally( $attachment_id ); return $metadata; } }