| 开发者 |
presswell
benplum |
|---|---|
| 更新时间 | 2026年5月1日 01:46 |
| PHP版本: | 6.1 及以上 |
| WordPress版本: | 6.9 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
/pwad-image/?id=...&size=...). The plugin includes an automatic compatibility check in wp-admin.
Regenerator
The Regenerator screen (Media -> Regenerate Thumbnails) builds a queue and processes images in batches, with progress metrics and retry handling for failed jobs. You can choose exactly which sizes should be regenerated.
Documentation
Public APIs
pwad_add_image_size( $args )
name, key, height, width, crop (optional), and optionally thumbnails values.[size]-[thumbnail].thumbnail, large, my-size, my-size-mobile, etc.)thumbnail, large, my-size, my-size-mobile, etc.)file, url, path, height, width, and mime-type values.
Example:
$square_large = pwad_get_image_src( $img_ID, 'square' );
$square_small = pwad_get_image_src( $img_ID, 'square-small' );
WP-CLI
wp pwad regenerate
Regenerates thumbnails.
--queue-per-page=<int> (default 200)--batch-size=<int> (default 25)--target-seconds=<float> (default 5)--resume-last=<0|1> (default 0, continue the last interrupted queue)--sitemap=<url> (optional, auto-detects from robots.txt/common sitemap endpoints)--page-limit=<int> (default unlimited)--image-limit=<int> (default unlimited)--delay-ms=<int> (default 250)--timeout=<float> (default 10)--retries=<int> (default 2)--include-external=<0|1> (default 0)--force-endpoint=<0|1> (default 0)--report-csv=<path> (optional, writes per-URL status/error report)--dry-run=<0|1> (default 0)--resume-last=<0|1> (default 0, continue the last interrupted prime run)--sitemap=<url> (optional, auto-detects from robots.txt/common sitemap endpoints)--batch-size=<int> (default 200)--max-images=<int> (default unlimited)--page-limit=<int> (default unlimited)--image-limit=<int> (default unlimited)--timeout=<float> (default 10)--grace-days=<int> (default 0, uses file modified time)--include-external=<0|1> (default 0)--force-endpoint=<0|1> (default 0)--report-csv=<path> (optional, writes per-file keep/delete report)--dry-run=<0|1> (default 1)--resume-last=<0|1> (default 0, continue the last interrupted prune run)--batch-size=<int> (default 200)--max-images=<int> (default unlimited)--include-default=<0|1> (default 0)--dry-run=<0|1> (default 1)--resume-last=<0|1> (default 0, continue the last interrupted clean run)wp-content/plugins/.
Configuration
When viewing an image in the media library click the 'Set Focal Point' button. Use the size dropdown to change the crop preview. Click and drag the blue focal point marker to identify the subject of the image. When finished, click the 'Save Focal Point' button to update the focal point settings and clear the image thumbnail cache for regeneration.
Focal points let you control crop framing across many sizes without manually defining crop coordinates for every variant.
Themes often register many custom sizes, but only a subset are used on the live site. Dynamic generation creates only the thumbnails that are actually requested.
Endpoint Mode serves generated images through a WordPress endpoint when your server does not pass filename-based 404 image requests to WordPress. The plugin can auto-enable this mode when compatibility checks fail.
Open Media -> Regenerate Thumbnails and run the regenerator, or run wp pwad regenerate from WP-CLI.
When migrating a large site it is beneficial to delete any generated image sizes to speed up the data transfer. Images will be re-generated dynamically when requested from the new location.