[WordPress] 外掛分享: PhotoFetch

首頁 › 外掛目錄 › PhotoFetch
WordPress 外掛 PhotoFetch 的封面圖片
全新外掛
安裝啟用
—
尚無評分
剛更新
最後更新
—
問題解決
WordPress 5.8+ PHP 7.4+ v2.0.0 上架:2026-10-15

內容簡介

PhotoFetch 外掛為 WordPress 控制台新增了一個「照片目錄」搜尋介面,讓使用者能夠直接搜尋、預覽並匯入照片至媒體庫。匯入的圖片可用於特色圖片、區塊內或相簿中,操作簡便。

【主要功能】
• 提供「照片目錄」搜尋介面
• 支援直接匯入照片至媒體庫
• 照片可用於特色圖片與區塊
• 自動去重,避免重複匯入
• 照片格式轉換功能
• 快取搜尋結果以提高效率

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.0.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「PhotoFetch」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

This plugin adds a “Photo Directory” search UI to wp-admin that talks to the
public Photo Directory REST API.
You can search, preview, and import photos directly into your own Media
Library, where the imported image behaves exactly like any regular upload
— usable as a featured image, inside blocks, in a gallery, etc.
Entry points:

Media > Photo Directory — a dedicated search/browse admin page.
“Photo Directory” button next to Add Media in the classic editor.
“Photo Directory” tab inside the native WordPress media picker itself
(Set Featured Image, Add Media, an Image block’s Media Library button,
etc.) — works in both the classic and block editor, since they share the
same underlying media picker.

Notes for developers

This is an unofficial integration with a public but not formally
documented API. includes/class-photofetch-api.php::normalize_item() is where
the raw JSON from the Photo Directory gets mapped into predictable
sizes/alt/author fields — it tries several plausible shapes
(media_details.sizes, an embedded featured-media object, a bare
source_url, etc.). If wordpress.org changes the API’s response shape,
this is the one function that should need updating.
Title and alt text are sourced independently: alt text prefers a real
alt-text field if the API exposes one, otherwise falls back to the same
text used for the Description field (see PhotoFetch_API::normalize_item() for
the exact priority order). It’s never derived from the title. For title,
known upstream placeholder strings (currently “Photo Detail”, “Untitled”,
“Untitled Photo” — see photofetch_generic_title_placeholders filter) are
treated as no title at all, and a fallback title is derived from the
photo’s slug instead (e.g. red-fox-in-snow → “Red fox in snow”). If
the slug itself isn’t usable, the title falls back to “Untitled photo”.
The attachment’s Description field (post_content) and alt text both get
the photo’s full description text; its Caption field (post_excerpt) gets
only the photographer credit line (e.g. “Photo by Jane Smith, via the
WordPress Photo Directory.”), or is left empty if no author name is
available.
The search/browse picker UI doesn’t display each photo’s title — many
photos on the Photo Directory only have a slug-derived fallback title
(see above), which isn’t meaningful to show while browsing. The title is
still set on the imported attachment; it’s just not shown in the grid.
Imports are deduplicated: each imported attachment gets a
_photofetch_source_id meta value, and re-importing the same photo returns the
existing attachment instead of downloading it again.
Image format conversion (Settings > Photo Directory,
PhotoFetch_Settings::get_format()) happens in
PhotoFetch_Importer::maybe_convert_image(), right after download and before
sideloading. It re-checks wp_image_editor_supports() at import time
rather than trusting the stored setting outright, and falls back to the
original file on any failure.
Search results are cached for 5 minutes via transients to avoid hammering
the upstream API on repeat searches.
All photos on the Photo Directory are released CC0 (no attribution
required), but the plugin stores the original photo URL and author name
(when available) as _photofetch_source_url / _photofetch_source_author attachment
meta for your own reference, in addition to the caption credit above.

延伸相關外掛

文章
Filter
Mastodon