I’m an idiot.
The reason the media uploader was not working, was because the post type I was using this on only had the title field set up in post type support. As such wp_enqueue_media() was not included as it normally would have been if the editor was included in post type supports.
To fix this I added
wp_enqueue_media();
to my cpt registration function.
Related Posts:
- Change behavior of “Insert into Post” based on attachment metadata
- Add new “Insert Into Post” button with another function
- Saving Custom Field in Attachment Window in WordPress 3.5
- How to save custom fields for attachments
- How to save media files under custom folder without changing wp-config.php or changing media settings
- How to add upload video option in wordpress for user?
- Custom dropdown field added to media gallery; how to get it to save properly?
- What’s the best way to add taxonomy’s image in 2017?
- Custom field in media library not saving, selected() function not adding “selected” to select list input type
- Adding fields to attachment – only shows when inserting new attachments
- How can I create more “create attachment” custom field – any idea?
- Insert wp gallery shortcode into custom textarea
- Media Custom Fields – get a value with PHP
- Save Custom Meta Value on Media Upload
- How to add a custom field in the advanced menu properties?
- Sortable Custom Columns in User Panel (users.php)?
- Importing data for advanced custom fields plugin?
- Gutenberg add a custom metabox to default blocks
- How to rename a custom field?
- Filter post listing by meta value which is a date
- Extra profile field as select box?
- Matching Serialized Arrays with meta_query
- Hook for image edit popup
- How to activate “custom fields” section in WP3
- How to filter or search the posts using postmeta tables custom meta fields with wordpress REST API
- Add meta data to the menu
- How to oEmbed from custom field, responsive to container size and responsive
- Copy SEO Meta Desc “Custom Field” to Excerpt field?
- Custom fields won’t display on my blog page
- How to customize default wordpress editor?
- Order Custom post type loop by custom field (datepicker)
- Add an advert every nth Paragraph
- Check if the value of a field has changed on save_post
- How to edit multiple post with Custom fields
- Undefined index error when saving content on metabox
- How to update custom user meta field in wp?
- How can I show custom fields in the loop only to specific user roles?
- Add conditional custom option to ‘Display name publicly as’ dropdown
- Custom fields not getting saved in the databse when added to the add new user profile page
- I want to send an email when each post is published
- Creating a widget with a number of custom fields
- Show 1 post and after a specific date show the next one
- How to Create Dynamic Fields in a Meta Box?
- Set front page option using custom fields?
- Can we create a WordPress read-only virtual field derived from three other fields?
- Custom Field Values not updating unless I click “Update” twice
- How to display image inside container of custom made widget
- Can I create a template or doctype for my blog site?
- Custom field, add class to anchor tag
- Custom Metabox additional item
- How to combine custom fields to make one order-able value
- Updating Other User’s Metadata
- get_posts in meta box dropdown not showing latest posts
- How to add new field to the account address?
- Split the_title
- Display Multiple Values of Same Key
- How to Wrote Simple Calculations by Using Custom Fields in Loop?
- Custom Query based on custom field of a single post
- How can I combine this php statement to get the results of multiple variable inputs?
- Access ACF fields within custom preview function?
- Looping inside block return
- Scripts and tags will not save or output from my custom meta box
- Sortable Custom Columns not sorting correct
- Is there a size limit to the value you can save in a custom field?
- Using WP Color Picker in Repeatable Fields
- Running wp_postmeta update query does not show the custom fields data in admin section
- How do I save Multiple fields in a meta box?
- How to load script conditionally on custom field in wp_postmeta?
- Can I access Posts of custom-fields via URL?
- Output custom field value
- Showing Custom Fields on Parent Page
- Best way to achieve multiple links in a post title
- Custom Theme Fields in Settings Menu – apply filters to one of those fields?
- plugin-list-category-post custom fields
- How to display data from custom fields I created?
- Get array of posts based on custom field values
- How to automatically change a posts status to draft based on custom field
- How to show ACF fields in Gridbuilder custom block
- multiple meta_query and orderby question
- Why isn’t update_post_meta saving?
- How to make menu country specific?
- Display taxonomy loop using custom field data
- Adding more fields to the registration form
- use mysql to replace one custom field value with another custom field value
- Change blog post title on main blog page
- Spit out list of distinct instances of custom field?
- Filter and display a specific custom field value [closed]
- Is it possible in WordPress
- Related post thumbnail not showing up
- Edit different parts of a page seperately
- I want my post to republish again after adding a custom field
- Custom fields: dropdown values depending on other custom field value
- How do i get a specific user metadata using custom metavalue outside of wordpress?
- Creating an If/Else statement using WPAlchemy MetaBox radio boxs
- How to retrive Custom Fields as Values for a Form field
- Custom fields doesnt work well with any postTAB plugin
- Colecting values from custom field checkboxes and displaying them in the post
- jaredatch metaboxes on video post formats
- Grouped Custom Meta Fields without plugin
- Is there any halfway decent documentation on the wp.media JS class?