When I was working on the same the issue was that when you try to add custom meta box before the post is created it did not work. So what I did was once the post was created added the following code
$imagepath = wp_get_attachment_image_src( $upload[1], $size );
update_post_meta($post_id, 'image_path', $imagepath[0];
So what happen’s here is that $upload[1] is the image attachment id and using the wp_get_attachment_image_src i will get the source of the image url which you can attach to a custom post. Or you can use another function but this is pretty much. I am assuming you want a image path there are lot’s of other function’s you can use
Related Posts:
- Submit post and upload image from front-end
- Front end post editing using a form
- Enable sticky posts to custom post_type
- How can I add a column/s to wp_posts table?
- How to hook get_terms() to only show count of posts that have custom meta
- Trying to save custom post type from frontend partially working
- front end radio custom taxonomy with custom post type
- add_meta_box: Datepicker like the one for postdate?
- Multiple information using custom post type
- Before Delete Post
- How to use custom fields to enable sticky posts on custom post types?
- Frontend posting – everything saves other than checkboxes?
- I am having a problem with form updating/editing WordPress post on the frontend
- WordPress Create Post from front-end
- Adding dropdown select meta box to custom post type – seems restAPI is interfering
- Posting to a Custom Post Type from front end – user generated content
- Update Post Meta for a logged in user
- Add custom field to Posts and sort by it
- Two Custom Post Types Many to Many Relationship
- How to integrate a form (Ninja Form or Contact Form 7) with Custom Post Types?
- Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?
- Submitting Custom Post Types with custom fields from Front-end form
- Modify Posts from Custom_Post_Type within the plugin
- Display custom meta on page that has been check in custom post type
- Making a form for user to add new custom post with custom taxonomies and custom fields
- Checking for custom field in admin pages
- A sports wordpress website
- Display custom post front end filter by ACF equals current user
- How to display custom field in product description?
- Show posts from WP Custom Post Type selected from a field in a metabox
- Multi Photo Upload with Caption on Front End for Custom Post Type
- WP_posts (Not meta) extra custom field column show and change it in a custom post type
- Calling specific page with wp query
- custom field suit new post with in custom fields
- Front end post or photo or both
- Display code if title of the custom post matches title of other post
- Advanced search form with filters for custom taxonomies and custom fields
- WordPress REST Create Post of Custom Type
- order by meta_value serialized array
- Custom post metadata not appearing in public API
- Display Custom Post Type in Recent Posts
- Slug for standard post post_type
- How do I create an archive page for standard posts?
- Remove parent from custom post type
- How to add the post ID (or any other post data) to a Contact Form 7 mail?
- Create a post in custom post type using field in registration form after users submit form
- How to add post_type=value when editing that post type in the WordPress admin?
- Publish an XML feed from a CPT with ACF fields?
- Want to Add Custom Fields for Uploading video to WordPress Users from front end
- Meta Key Value in current-user-only loop
- Custom Posts Types as Custom Fields
- dynamically add a custom field or metabox to custom post type [duplicate]
- How to implement a Google map store locator
- retrieve Meta field value from CPT and set those values as Image Meta Field “Title”
- Woocommerce custom field search in custom post type [closed]
- Prioritize posts in query by meta keys?
- Meta Query posts not showing on ending date of custom field
- Custom Post Fields at the beginning of a Custom Permalink
- Possible to filter custom post type with multiple meta data?
- Create custom post with meta field with AJAX and the WordPress REST API
- Specifying meta field’s column type in Database using add_post_meta
- Is it a good idea to add a column to the posts table?
- wordpress lists similar type of posts in a custom post type
- How to get_term_meta on single custom post?
- How to fetch custom post types with its full data on wordpress?
- Show related posts based of current ACF field name in a single page post (a loop within loop)
- list posts of two post types in a single template
- Adding a Custom Field to be used by Posts 2 Posts
- Custom Post type to Woocommerce Product type
- Auto delete pages/posts without views
- Display Posts that fit a certain criteria on Category pages
- Sort custom post column by generated value?
- Filter posts by their related field’s custom field
- WordPress retrieving $post based on random key in $_POST
- How can I register multiple custom post fields to json?
- minimize wp_query call to database
- Post display in separate page [duplicate]
- sorting in wp query based on custom field value
- Delete Post by User
- PHP Notice: Unidentified index
- Setting up a page to house certain types of posts
- WordPress loop add heading before first of type
- How do i create user accounts from custom posts that have email addresses
- Only show current category post
- WordPress Contents Migration
- Best way to use Category & Custom Fields?
- Add a image to a post published on a CPT from the front-end
- How to make post page unique and show it on home page?
- Is it good practice to search for custom posts based on custom field values?
- Custom post type with custom fields enabled, is there a way to set a default group of fileds?
- Storing/querying custom date data
- Query Posts From Multiple Post Types
- WP Build-In Post selector for CPT
- Custom Post Meta on a Different Page?
- How do I hide single category post on my post page
- Can WordPress show posts based on a button that the user clicked 2 pages back?
- Creating post custom field text area
- querying to custom field over ACF REST API
- Post object GUID adding http:/
- Query order by a numeric ACF field