Wp Admin Media Frame

Open the standard WordPress Media Library picker from plugin admin UI with `wp_enqueue_media()` and `wp.media()`. Covers the screen-gated enqueue, `media-editor` dependency, `wp.media( { frame, title, button, library, multiple } )`, `library` filters for type / MIME / uploadedTo / author, `multiple` values `true` and `'add'`, `select` and `open` events, `frame.state().get( 'selection' ).first().toJSON()`, attachment `sizes`, frame caching, pre-selecting existing attachments, and saving attachment IDs instead of URLs. Use for image, file, gallery, logo, avatar, cover, or per-row icon pickers in settings pages, metaboxes, and repeaters.

vikingokft dbe0cea 2 files · 17.5 KB Updated 0 repo stars

File contents

vikingokft/vikingo-studio-skills/tree/main/wordpress/wp-admin-media-frame commit dbe0cea638

Frequently asked questions

npx skillmds add vikingokft/wp-admin-media-frame