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,
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.