wp-admin-media-frame
OfficialOpen WP Media Library and return attachment IDs
Software Engineering#plugin UI#media picker#wp.media#wordpress admin#attachment ids#javascript frame
Authorvikingokft
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This skill solves the common WordPress plugin admin challenge of correctly opening the standard Media Library modal (wp.media) and wiring it to your UI so users can pick/upload media reliably.
Core Features & Use Cases
- Admin-safe Media enqueue: Enqueue media assets only on the correct admin screen with wp_enqueue_media and the media-editor dependency so wp.media isn’t undefined.
- Working picker UI patterns: Build the trigger + hidden attachment ID input + preview container used by settings pages, metaboxes, and repeater rows.
- Correct selection handling: Use the wp.media frame lifecycle (open/select events), filter the library by type/MIME/uploadedTo/author, support single or multi-select modes, pre-select an existing attachment, and save attachment IDs (not URLs) with proper thumbnail sizing fallbacks.
Quick Start
Use the wp-admin-media-frame skill to implement a button on your plugin settings page that opens the WordPress Media Library and stores the chosen attachment ID in a hidden input for later saving.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: wp-admin-media-frame Download link: https://github.com/vikingokft/wp-agent-skills/archive/main.zip#wp-admin-media-frame Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.