You can achieve the goal through many ways. though the way you have selected is not an appropriate one but you can go with it also. just include the file wp-blog-header.php file (placed at the wordpress root) into validation.php above all other code. you can find all the wordpress related functions will work like a charm.
Related Posts:
- How to submit the date with ajax?
- Get post ID from wp_insert_post()
- Debug whats going on inside a function called from AJAX
- Getting the URL of the parent page
- Custom post type – use ajax to display sub pages
- Frontend Post with JQuery AJAX to Php Issue
- Load Next Posts With AJAX not working with custom post type
- WordPress notification if new post published
- passing values from functions.php to template
- Display custom-post type based on the Title matching the current selected value
- WP_Insert_Post creating duplicate posts when logged in
- How can I create a button that when clicked populates a div with a list of foods that are checked as a certain type of ACF?
- Attend event form with ajax
- Show ajax form resuslts in page
- Collect custom post in a calendar
- Received nothing after executing AJAX post function
- Filtering WP_Query Dynamically on the Front-End
- How to retain $_POST data when submitting form to custom page
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Storing posts from query and accessing later via AJAX call
- Loading custom content type from ajax results?
- Display users uploaded files as posts
- Form isn’t inserting data into database with ajax plugin
- Post form as custom post
- create parent post using wp_insert_post
- How to add a custom-post-type post within another custom-post-type post edit screen using AJAX?
- AJAX load more for different custom post type loops
- Ajax loaded form replaces form action with Ajax url
- Ajax Custom Post Filter is not filtering
- prevent default not stopping page refresh. Passing form information to and from php with ajax in a wordpress site
- Cron job for creating posts not excecuting properly
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- JS innerhtml changing style when using AJAX
- How to checked selected category checkbox when my custom post inserted from frontend
- Form action/link to render a plugin in WordPress front-end
- Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
- Load Custom_post_type categories post with ajax
- How to integrate a form (Ninja Form or Contact Form 7) with Custom Post Types?
- Help to upload post attachments from Ajax
- Dynamic Custom Fields
- A form that can save/edit after first input
- Show success or error messages in Ajax response to WordPress custom registration form
- How to make front end form only accept certain values
- Edit Custom Post Type on Custom Admin Page instead Post Admin
- Using POST method in meta box, no results
- Post author for revision not being set on update/insert
- Pagination with custom query, custom search form, single and pages, ajax and no plugins
- Form action doesn’t work if slug isn’t same as custom post title
- Add CPT values to Database
- Retrieve custom post types by custom taxonomies with WP_Query
- WordPress admin-ajax.php 400 bad request
- Why cant I add a custom post type to a custom taxonomy?
- $post not working working in AJAX plugin with custom post type
- AJAX fileupload – TypeError: not a function ajaxSubmit()
- Ajax contact form return 0
- Load Next WordPress Posts With AJAX?
- Dynamically output a class to an anchor tag depending on what tag is chosen
- Why won’t this jQuery code work?
- Custom post type’s extra fields – how to handle?
- 404 Error on form submission within custom post type
- Custom Post Type Slick Slider “$ is not a function”
- show custom value from frontend form in a post (custom post type)
- Getting 400 Bad Request on AJAX Call
- wp_insert_post wrong post type [closed]
- Ajax form submit not working, returns 0
- Programatically inserted posts not showing in Posts Table
- admin-ajax.php GET custom-post titles
- Is it possible to add posts and images (auto resize) for custom post types with a script?
- Post will not load via ajax
- Select2 AJAX and WP Query Returns ALL and does not filter
- Update post if exist from PHP
- ajax response not recieving
- WordPress hook which triggers on post import
- Getting a GET error in console – 404 not found for wp-json
- filter by custom taxonomy using ajax
- How to handle new post from API request?
- Output multi-steps form results in same page
- How to handle this specific case of custom post type?
- How to Query in WordPress which shows Alphabetic Posts?
- Direct form to a custom page template
- How do I update_post_meta() or add_post_meta() with an AJAX call
- Revert to previous dropdown options after change
- Creating a Tabbed Widget
- insert image with custom post type
- Multiple wp_editor instances in custom post type using Ajax
- How to selected value default in option list?
- importing table data to custom post type
- How can I implement jQuery plugin correctly with my CPT?
- Masonry Append WordPress posts with singleMode
- How can I get some of a posts meta data whilst it is still inserting?
- Displaying information from custom field on custom post type
- I can’t connect my custom jquery to wp admin
- Change Post Meta via AJAX from the posts list table
- Making a form for user to add new custom post with custom taxonomies and custom fields
- Using AJAX to run SQL statement and populate dropdown
- Converting a working AJAX form to work with WordPress
- Weird issue where form field loses focus to previous form field even with JS disabled
- Submit Custom Postypes from frontend
- jQuery UI & Admin (Calendar)
- jQuery forms & updating info