Skip to content
New issue

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

media regenerate removes/doesn't recreate custom site-icon sizes #79

Open
dotsam opened this issue Jun 22, 2018 · 1 comment
Open

media regenerate removes/doesn't recreate custom site-icon sizes #79

dotsam opened this issue Jun 22, 2018 · 1 comment

Comments

@dotsam
Copy link

dotsam commented Jun 22, 2018

Summary

When regenerating all media, the special-case site-icon loses its custom sizes

Steps to Reproduce

  1. Through Customizer -> Site Identity, add a Site Icon
  2. Observe that in addition to the originally uploaded image present in the media gallery, a 2nd "cropped" variant is created with unique image sizes
  3. Run wp media regenerate --yes
  4. Observe that the cropped variant's sizes are replaced with the standard active sizes

Environment

  1. PHP 7.1.16 (cli) (built: Mar 31 2018 02:28:54) ( NTS )
  2. $wp_version = '4.9.6';
  3. WP-CLI 1.5.1
  4. twentyseventeen theme, no plugins

Severity - Low

Expected Results: The special case 'site-icon' should be handled as it is in core to generate the correct media sizes

Actual Results: The site-icon image attachment is handled the same as all other uploads, and loses its special sizes, which may cause issues with devices/services looking for/expecting to find images of a particular size. The meta tags output in the site header do link to the newly generated image sizes, but attributes on the meta tags still show the original sizes that were expected to exist.

Core is only expecting this image to ever be set via the customizer, so the case for it is handled in ajax-actions.php which calls on the WP_Site_Icon class from class-wp-site-icon.php.

File and metadata before/after regeneration: https://gist.github.com/dotsam/f31dfed2ee1b64b149883520ee901b43

@schlessera
Copy link
Member

We should include a hardcoded check for this edge case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants