Try using media_handle_upload()
instead, solved a similar problem for me.
Related Posts:
- How to use media upload on metabox post page without breaking TinyMCE?
- What is the index [0] for on post meta fields?
- Custom field metabox not showing in back-end
- How to hide meta box values from custom fields list?
- Using media-upload.php to upload mp3 via custom fields
- Create meta boxes that don’t show in custom fields
- Custom fields to save multiple values
- Metabox with multiple fields added by user and upload box
- Metabox image upload and custom field
- Create Multiple File Upload Metabox in WordPress
- Button inside Custom Meta Box triggering the Update Button
- Why is my Custom Meta Box Field Inputs NOT saving?
- get_posts in meta box dropdown not showing latest posts
- How can you include custom post meta in search without calling each key?
- Display Custom Meta Box Field Only If Value is Present
- shortcode in a custom metabox
- Problem with saving large amount of data in postmeta/usermeta
- Move Title and the Content WYSIWYG editor position
- How to validate select field in post meta?
- Let’s Create Custom Field Template Documentation
- How add multiple wp_editor_box to new post
- Can I save post meta programatically without setting metaboxes?
- Meta box values are displayed on Custom Fields list. Is it possible to hide them?
- If metabox has content display content
- put saved metabox values back into fields and then display on the front end
- How to improve my non-unique metadata MySQL entries?
- Set class if a meta value is set within post archive
- WordPress Blocks, setAttributes not saving
- Allow HTML in Custom Metabox area
- Custom field metabox not showing in back-end
- Save, update, get and sanitize post meta as HTML not plain
- Create Meta boxes dynamically
- Get meta value when the page is a blog archive
- Can’t save meta field value if the title not set
- Display Data From This Custom Media Upload Meta Box?
- When post is updated, custom metadata in text area field is overwritten
- Custom Meta Boxes and Fields for WordPress: Change directory upload based on user-edit page
- wp_postmeta are updated for only one page
- When editing a post with a custom meta box the values aren’t displaying correctly
- How to add new Metadata options (Date, Author, etc.) for Posts?
- Saving multiple custom meta box fields
- wordpress multi user question
- Working with multiple values and metaboxes
- Custom Meta Data is not being saved
- Meta field bulk editing no longer working in WP 6.0 [closed]
- How do I upload file through custom field, save it to database and get it
- show a specific metabox dependent on the page template
- update_post_meta not working well
- How can I change author of posts to the value of one of the custom field of the posts?
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- Gutenberg add a custom metabox to default blocks
- How to display custom fields in hestia theme
- Custom meta fields and meta keys
- Making custom meta box required (with error message if not filled in) on Gutenberg
- HTML for adding a meta box (basic text field) to page editor?
- Adding Custom Metadata to my Archive/Posts page
- Move the metaboxes to the very top of post editor
- Adding text box with add_meta_box
- Add forms dynamically in admin pages?
- How to add a post’s view count into the WordPress API response
- How to speed up post list slowed by update_meta_cache()?
- Using Customizer API vs Custom Meta Box for custom content
- non-unique #_ajax_nonce id in browser console
- How can I ‘check’ the “custom fields” box from the Screen Options?
- Adding Facebook’s image and meta description retrieval capabilities to a WordPress post
- Can’t set custom meta fields for a post
- Saving Custom Field that includes Quotation marks
- Custom Fields Not Showing (ACF not installed)
- SQL query to change the value of a Custom Field
- Metabox/Custom fields are not saving input data
- Custom meta POST request fired twice when updating a post in Gutenberg
- add meta box considers the selected option as post parent
- Can you generate a featured image from two images from custom fields?
- Issue on Creating Checkbox Field On Custom Post type
- Post meta data not showing in frontend, until hitting ‘update’ button
- Creating a “Related Meta” type field?
- WordPress admin area: select box with 12.000+ options
- searching by keywords in post’s metas or pagination links problem
- How do I display a custom field in an existing form on the front end?
- Add custom field information to source meta data
- How do I update custom field post meta in frontend post template?
- Update custom field on page specific to logged in user
- How to Find List of Available Custom Fields for Theme?
- How to display selected option from dropdown list in a metabox
- Why does this javascript search function in the WordPress Admin not work?
- update meta field value after
- get wordpress post loop by meta box date
- want to add video upload option for front end user
- Custom Fields Not Working In Footer
- Update custom table on metabox POST
- Sub Field of File Field
- ACF plugin and field update
- Save input form on custom field
- Metabox value for post loop?
- how to modify a field’s size in a metabox : ROWS height, and scroll control?
- Saved Post Meta Array Returns as String
- Query Multiple meta
- If metabox fields has content display content
- Delete custom meta
- Delete custom post type metadata without deleting the post in admin area