Open azaozz opened 5 years ago
Thanks for the heads-up, @azaozz !
Yes, that looks like it would make everything a bit more streamlined. However, it also means maintaining two separate execution paths for solving the same issue, which might have different results...
I'll have to spend some time looking into this to see how best to support this new functionality.
Just an FYI that from WP 5.3 there are couple of functions to find and generate missing image sub-sizes, and the image meta is saved after each sub-size is generated.
For back-compat
wp_generate_attachment_metadata()
still returns the whole image meta array after all sub-sizes have been created (if the server doesn't run out of resources), but is not the best way to generate only missing image sub-sizes. See https://core.trac.wordpress.org/ticket/40439 and https://core.trac.wordpress.org/changeset/45538 (testing and suggestions welcome).