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
- How to automatically update ACF field value every year?
- Is there a way to get a file URL from the relationship ACF field?
- Display custom fields on post excerpt or teaser
- WP_Query orderby modified to include custom meta changes
- WordPress custom loop filter by meta_key and value with serialize data
- Adding Show Less/More link to Custom Post Meta
- Returning a list of custom post types excluding those without a specific meta_value
- Want to Add Custom Fields for Uploading video to WordPress Users from front end
- Keep display metadata value on backend – Custom Metabox
- How to restrict CPT post’s fronted view only for specific user roles?
- How to bulk copy custom fields between custom posts?
- Show the same Article Available in Other Categories
- Getting posts under the custom post type ui category
- Sorting custom post type columns with external data and without meta values
- Storing posts from query and accessing later via AJAX call
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- If post has custom field then display css-class
- Meta Key Value in current-user-only loop
- Retrieve value of a category’s custom field
- Calculate all custom field values in the post loop
- Rewrite and custom post type: order by custom field not working
- How to save custom taxonomy from front end post submission
- add custom field to custom post type
- How to set up multisite for multi language?
- CPT Group by Date metabox Value
- How to check if user meta field is empty in conditional else statement
- Replace text in post from cvs
- Admin search ACF relationship
- Display only one post each WEEK
- wp_query check if integer exists in custom field’s array
- List children on child post
- How can I dynamically add a post to a custom post type which uses a custom field?
- Restrict custom post type from appearing with ?post_types=
- Show custom post type filtered by category
- Filtering custom post type on a combination of custom taxonomies and custom fields?
- Custom Posts Types as Custom Fields
- create parent post using wp_insert_post
- Get image post ID in media upload
- Turn on and off custom post type from admin?
- Missing Posts in Custom Taxonomy List
- Insert Custom Post Type data from the front-end by a user
- Display random posts, but omit the post it is on?
- Why is my select meta data not saving?
- How do I do this with WordPress? Taxonomies?
- dynamically add a custom field or metabox to custom post type [duplicate]
- Crafting WP_Query array, sort by date
- Give a permalink to Custom Post Types without title
- Disable block with taxonomies at post page
- Role scoping for contributors down to the field level
- How to implement a Google map store locator
- I would like to have different styles for my posts based on the content of each post
- Creating a Custom Post as a repository for theme constants
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- search also in taxonomy, tags and custom fields
- Random image from tag/custom type on sidebar
- Showing posts from different categories and from custom post type
- Get latest 3 posts from multiple CPT in one query
- How to stick custom post at the top in search results
- Allow non-logged in users to see a future post after clicking on a list of future posts
- Which post does a taxonomy term belongs to?
- How do I create custom fields for multiple post types?
- Add field to all custom post types
- List custom taxonomy specific to one custom post type
- Query & Order posts by custom fields