For your my_ajax_admin_add_track() function, grab the form field data from the $_POST array, populate the required data in an array to call wp_insert_post(), then call wp_insert_post() passing it the post data. It should return the new post ID number if successful.
Related Posts:
- Remove rows in the manage post/page view
- How we can create menu from Appearance > Menu and use as a add-submenu-page for admin menu?
- Placing a Custom Post Type Menu Above the Posts Menu Using menu_position?
- Loading External Scripts in Admin but ONLY for a Specific Post Type?
- How to add custom columns to Custom Post Type admin screen
- Is it OK to move admin menu items?
- Prevent reload confirmation after AJAX save
- How to Change the Title of a Meta Box on a Specified Custom Post Type? [duplicate]
- How to add post_author column to custom post type
- WordPress User Roles, Custom Post Types, and Admin views
- How to make post sticky in the admin page?
- How to customize admin posts based on the user who is logged in
- Is there a way to have the view link on manage posts page to open in a new window or tab?
- Storing posts from query and accessing later via AJAX call
- Selecting a post in Dashboard
- Custom admin post.php page
- JS innerhtml changing style when using AJAX
- No Permission to add new Page, Post or CPT with Admin role
- Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
- Admin Column does not populate with data
- Load Next Posts With AJAX not working with custom post type
- $post not working working in AJAX plugin with custom post type
- Load Next WordPress Posts With AJAX?
- WordPress notification if new post published
- How do I edit the WordPress post.php file?
- Multiple wp_editor instances in custom post type using Ajax
- Change Post Meta via AJAX from the posts list table
- Admin slow on Postlist (over 30k Posts in Database)
- How can I put content before my custom post type default pages?
- list articles in admin showing nested categories or slugs?
- Publishing failed. The response is not a valid JSON response
- Limiting the Number of User Posts to Their Own Posts
- WordPress Author Posts Review After Every Change In The Same WordPress Post
- Hide load more button if no more post in selected category
- Passing total post count to javascript
- Default post showing more than intended
- Display posts of only a certain category in WP Admin section?
- Ajax load more post button not showing
- How to set up a private custom post type that is accessible in the administrative dashboard?
- Linking to Post Types from wp-admin
- Post will not load via ajax
- Plugin or method of allowing user to rearrange custom post types with drag and drop?
- Creating separate feeds for custom post types
- Get_the_terms restrict output
- Custom post type menu
- CPT Columns doesn’t show categories
- Hide Status Option From WordPress Publish Metabox and Rename Published on:
- Insert Custom Post Types
- Create field of Custom Post Types
- sortable columns for multiple custom post types not working
- Select2 AJAX and WP Query Returns ALL and does not filter
- Stores category posts in an array
- Query within a foreach within a query (queryception)
- How to implement a different permalink structure for custom post type?
- Custom Post Type – Support “author” only for admins
- wordpress lists similar type of posts in a custom post type
- Add to ‘action’ within post.php to allow more actions when editing a Custom Post Type in a plugin
- ajax response not recieving
- I can no longer post or even save a draft, getting the error “A post type mismatch has been detected.”
- Published post auto change status to pending after 90 days
- How to retrieve all wordpress posts (specific type) inside a function in php?
- Showing User’s Post Counts by Custom Post Type in the Author.php?
- Generate new post from email
- YOAST SEO won’t work on custom post type archive [closed]
- Auto post creation
- Custom posts of one type have disappeared from admin. Still appear on site [closed]
- Getting a GET error in console – 404 not found for wp-json
- How to get the custom post list to admin user edit page?
- Batch Extract Date from post title and put into ACF custom field
- filter by custom taxonomy using ajax
- display posts of custom post type with custom taxonomy
- How to handle new post from API request?
- Copy order items with metadata between orders – Woocommerce
- Automatically update slug with latest title within custom post type [duplicate]
- Modifying the default post from wordpress
- passing values from functions.php to template
- Dynamic pages for linked categories and content
- Separate Content from gallery (custom post type)
- Change link for “add new” buttons on custom post type
- Restrict category access to specific users/groups. Author always has access
- Modify Posts from Custom_Post_Type within the plugin
- Add ‘page template’ column to dashboard for CPTs
- Get post format
- How to add new post using a form to categories when categories are using as menu
- Custom wordpress loop
- Remove value from array within post meta ajax admin
- How to set the mainpage of a custom post type?
- Different post title, keywords and description
- How to Query in WordPress which shows Alphabetic Posts?
- Post Query not working
- displaying content of custom post type
- Custom Post Type – Portfolio no longer works
- how to get options to choose post format in add new post
- Posts are not rendering perfectly [closed]
- Render a Post or Page using the correct file
- WordPress Count posts within a custom post type
- How to filter url on post submission?
- How I can made a custom post type to page templates?
- Filter posts of custom post type by meta key in (List All Section)
- Best practice for plugin: always detect admin-ajax call?