use these:
$imgurl = isset( $values['upload_image'] ) ? esc_attr( $values['upload_image'][0] ) : '';
<input id="upload_image" type="text" size="36" name="upload_image" value="<?php echo $imgurl; ?>" />
<input id="upload_image_button" type="button" value="Upload Image" />
if( isset( $_POST['upload_image'] ) )
update_post_meta( $post_id, 'upload_image', wp_kses_data( $_POST['upload_image'] ) );
Related Posts:
- Add “upload media” button in meta box field
- Add a Meta Box for uploading a SECOND Featured Image?
- WordPress SEO by Yoast: Hide Meta Boxes in Posts for Non-admins
- How To Remove The “+ Add New Category” Link From A Category Metabox
- Removing Metabox for “Slug” without removing functionality
- Attach Files Metabox
- Adding uploaded images to editor from metabox instead of default popup uploader
- I need a Simple image uploader with a simple screen. WP default has too many options.
- Customize WordPress Media Upload and New Media Manager Menu in add post Metabox
- Setting multiple image urls using WordPress’ Media Uploader
- Problem with meta box in Links
- How to modify Publish metabox?
- I’m using add_meta_box() but want to include TinyMCE editor *and* Media Uploads for each box
- WPAlchemy MediaAccess inserting media link in WP Editor instead of custom field in metabox [closed]
- Set default value for radio button in WP Alchemy custom meta box?
- My custom write panels won’t save data. What am I missing?
- How to add meta box for image upload using WordPress media uploader?
- Insert media button will always add into the same tinyMCE editor
- remove a single post_meta
- save meta data of custom post type: WP_Error has no effect, even if insufficient capabilities
- Custom meta box using OOP way doesn’t save data
- Generating image sizes when uploading through wp.media
- Upload button in metabox not working
- Select Options Meta Data is Not Updating in Edit Meta Box
- Creating a metabox to upload multiple images
- Post custom metabox textarea using wp_editor
- Prevent sorting and dragging of specific postbox metabox
- How to move wp-content (or uploads) outside of the WordPress directory
- Removing meta boxes: remove-meta_box() or unset()?
- CMB2 metabox conditional logic
- How to pass variable via $callback_args for add_meta_box
- Undefined function error when creating Custom Meta Box
- Move excerpt to always be directly below post content in admin
- Getting the ID of a meta box
- Custom filter for the_content doesn’t work correctly
- Check if meta key value already exists
- Is there a predefined callback function for custom categories?
- Conditional Meta Boxes
- Why is `add_meta_box` not working?
- How to access global $wp_meta_boxes variable on front-end?
- prevent post submission
- Problem in custom meta boxes
- $post->ID incorrect within meta box
- Why is save_post hook not running?
- Metabox with multiple fields added by user and upload box
- Why is variable value emptry in $_POST but available in $_REQUEST?
- How to re-arrange media uploaded using : media_handle_upload() as per year / month
- Change headline text for post thumbnail meta box
- how to save multiple checkboxes value in wordpress dynamically
- The Best Way to always load the newest version of 3rd party code
- Creating an “admin only” meta box with WPAlchemy. Getting a fatal error on front-end when using current_user_can
- Multiple Meta Boxes in separate files
- Meta box html is not updating after saving
- wp_generate_attachment_metadata is creating an empty array
- custom meta box for page default template
- Store multiple textarea data in database from a metabox
- Is there a way to display metabox in frontend? How?
- Custom Sortable Meta Boxes
- How to hook something before edit_form_title?
- Display Term Metabox Only On Certain Term Edit and Add Pages In Admin
- How to prevent further updates of custom meta when using actions to set one meta based on another
- Stop saving process when metabox is invalid [duplicate]
- List all sidebars in metabox
- Is there a way to create a meta box that can be added multiple times to a post dynamically?
- Parse a text area custom meta box and assign as value to existing meta keys
- WordPress global variables?
- More Fields & Media Upload
- I have added a metabox and inside it i added a secondary title and a text editor but if i write anything it does not save it or show it on my page
- Starting with tabbed metabox
- How many meta-query fields support WordPress search at a time?
- Cannot remove meta box added through OOP
- Remove meta box except on category pages
- Media Upload not working after hiding some elements from functions.php
- Adding metaboxes to attachment pages
- WP admin display custom field if another field value is “Female”
- Save JSON object attributes to custom metabox
- Metabox image upload value
- Multiple header style under meta box
- get_post_meta giving errors while creating a metabox
- how to Add Meta Box with featured image settings and To Edit Post Screen For Inline Styles (css box)?
- How to determine wether a post gets just created
- Load meta box inside meta box.. is this possible?
- Adding a drop-down (select tag) option under Menu Settings in WordPress Admin
- get_post_meta not working on my custom-function page
- Change meta-box title- “LearnDash Quiz Settings” to “Quiz Settings”
- Save datapicker date into wordpress admin
- issue with saving custom metaboxes fields
- How Add a Save Button to Custom Meta Box without Leave/Stay js Dialog?
- Removing Meta Generator
- Change post template the proper way
- Custom meta box repeated field
- Using Meta Boxes in a Custom Page Template
- Custom carousel with meta box data
- show title if one of post meta exist
- Query a Custom Post Type to another CPT via Metabox
- Custom metabox with App Store / Google Play links
- Metabox doesn’t retain values
- How do I allow Authors and Contributors to use the metabox
- CSS styling not working in a custom metabox
- Is there a way to remove the Add boxes from the Screen Options menu metabox?