For starters, the ‘post_category’ argument only accepts category ID’s, so you will have to find that through your database, or through get_category_by_slug:
$cat = get_category_by_slug( 'music' );
$cat_id = $cat->term_id;
Secondly, look at your wp_handle_upload() section. You are passing $file[‘file’] in both cases, where ‘file’ is not the name of either of your upload fields. I believe it should be:
$uploaded_music = wp_handle_upload( $file['music_file'], $overrides );
$uploaded_music_art = wp_handle_upload( $file['music_image'], $overrides );
Related Posts:
- limit amount of photos uploaded per cpt post
- Front end register with custom fields
- Front-End User Profile
- How to insert multiple checkbox values into post as custom fields from frontend
- WordPress AJAX File Upload – FrontEnd
- How can I make wp-pagenavi work on a custom query built upon a form submission? [closed]
- Using media-upload.php to upload mp3 via custom fields
- Extend WP Customizer to make multiple image selection possible
- Saving Custom Field in Attachment Window in WordPress 3.5
- Up/Down voting system for WordPress
- WordPress custom upload field error
- Save attachment custom fields on front end
- Front-end update_post_meta with ajax
- Datepicker not supporting timepicker
- Metabox with multiple fields added by user and upload box
- Metabox image upload and custom field
- Custom image sizes for custom field media uploads
- wp_handle_upload error “Specified file failed upload test” but still creates attachment?
- Insert attachment ID in custom field from media uploader
- How to save media files under custom folder without changing wp-config.php or changing media settings
- How can I store a file in the database in the same way WordPress and ACF do?
- Front-end editing with custom fields?
- How do i save and retrieve custom attachment meta?
- Excluding Specific Fields from Profile Builder Registration Form
- Is there a simpler version of WP Media?
- Client PDF Upload (Catalogue) – Automatically update link to PDF
- How to add upload video option in wordpress for user?
- Custom field as Slug
- Edit User Profile From Front End
- Uploading PDF using Media Uploader
- Select multiple images from custom field
- how to make nsfw post with thumbanil
- ACF form edit front end post title does not change permalink
- WordPress Media Uploader custom Javascript not working
- Uploading PDF files from the front-end
- How to use media upload on metabox post page without breaking TinyMCE?
- How to add fields in custom registration form, validate it and aave to db? [closed]
- WordPress Settings API Repeatable fields
- frontend submit post jQuery clone row won’t save
- Advanced Custom Fields and Post Meta Fields Relation
- How to update user profile custom fields
- Woocommerce frontend edit custom fields
- Modify custom field from front end
- Image upload and path to custom field
- How to delete file uploaded by Plupload
- Adding extra fields to front end signup form
- How do I upload file through custom field, save it to database and get it
- Changing form action based on selected value
- Let any visitors delete a post if they know Id nr & password?
- Can you generate a featured image from two images from custom fields?
- How do I display a custom field in an existing form on the front end?
- How do I update custom field post meta in frontend post template?
- Multi Photo Upload with Caption on Front End for Custom Post Type
- Contact Form 7 List Building
- what would be a good example of a php dynamic code to display contents of textarea?
- want to add video upload option for front end user
- Login_form add to top of form rather then bottom
- display custom media folders to wordpress media popup
- Custom Meta Boxes and Fields for WordPress: Change directory upload based on user-edit page
- Change path to child of page when uploading image via custom field
- Meta Box Data added to header redirect
- How can I create more “create attachment” custom field – any idea?
- Form fields based on custom fields
- How to allow user to add to, but not edit, a post?
- Upload image to wordpress
- Bypassing a Form Options
- Multiple image uploader under editor?
- unlink() doesn’t delete the uploaded file
- Save Custom Meta Value on Media Upload
- ORDER BY custom field value
- Create a select drop down of available menus
- Slow meta query with multi meta keys
- Custom Field Multiple Clauses
- Send Multiple Custom Field Values Through the URL
- Frontend posting – everything saves other than checkboxes?
- $wp_query meta_key naming issue [closed]
- Woocommerce with metabox plugin
- using multiple meta_key and meta_value in query_posts
- global function to apply filter to custom field
- How to add a new meta key and assign timestamp to posts
- Print custom field in Query Loop block
- Order RSS content by an advanced custom field value
- Advanced search by two criteria – sort by location and date (ascending or descending)
- Submit page limited in time to upload image
- Collect user custom field in product page woocommerce
- get posts where a custom field contains a text
- Displaying a custom field
- User customising position of WordPress Featured Image
- Custom field php
- how to add product subscription field in woocommerce plugin
- How can I change the publish date based on a custom field?
- Change Page Order by Custom Field (Magic Fields)
- Adding Facebook’s image and meta description retrieval capabilities to a WordPress post
- Should I store arrays in custom fields or create custom tables?
- Problem saving meta data
- WP_query returns error when used for custom widget
- woocommerce how in checkout to add my custom field check box, and when i check it hide the shipping adress and add tax 19% [closed]
- How can I attach files without using a plugin?
- Change Fields of Comments and make them searchable?
- Multiple permalinks for a single post from custom field