Image Sizes in Admin Dashboard

外掛說明

Image Sizes in Admin Dashboard adds a read-only widget to the WordPress admin Dashboard that lists all currently registered image sizes.

Any size you register in your theme or plugin with add_image_size() is picked up automatically, alongside the built-in thumbnail, medium, medium_large and large sizes. Each row shows:

  • The image size name (human readable)
  • Width in pixels (— when unconstrained)
  • Height in pixels (— when unconstrained)
  • Crop mode (Cropped or Proportional)

This is handy when building a theme and you need a quick reference of the exact dimensions available to the_post_thumbnail() and the media library.

More detail on registering custom image sizes: https://developer.wordpress.org/reference/functions/add_image_size/

螢幕擷圖

安裝方式

  1. Upload the image-sizes-in-admin-dashboard folder to your /wp-content/plugins/ directory.
  2. Activate the plugin through the Plugins menu in WordPress.
  3. Open Dashboard in wp-admin — the Image Sizes widget appears for administrators.

常見問題集

Who can see the widget?

Only users with the manage_options capability (administrators by default).

My custom size is not listed

Make sure add_image_size() runs on the after_setup_theme or init hook in your theme or plugin so the size is registered before the Dashboard loads.

Does this work on Multisite?

The widget renders on each site’s Dashboard. To show it on the Network Admin Dashboard, hook the registration to wp_network_dashboard_setup instead of wp_dashboard_setup.

使用者評論

閱讀全部 2 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Image Sizes in Admin Dashboard〉的開發相關工作。

參與者

將〈Image Sizes in Admin Dashboard〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄。

變更記錄

2.0.0

  • Rewrite for WordPress 6.5+ / PHP 8.0+.
  • Namespaced, object-oriented architecture (no more global functions).
  • Output fully escaped (esc_html / esc_html__).
  • Capability check (manage_options) before registering and rendering the widget.
  • Sizes now read via wp_get_registered_image_subsizes() instead of the private $_wp_additional_image_sizes global.
  • All strings internationalized under the image-sizes-admin-dashboard text domain.
  • Adds a Crop column and a clean responsive table layout.
  • Fixes undefined variable warnings on PHP 8.x.

1.0.0

  • Initial release.