In your code, if an email is set and validated (which I suppose should be the normal case), your code will exit at wp_die(), and never reaches the $wpdb->insert.
Your $wpdb->insert statement will only ever be reached if an email is not set, or if “validation” is false.
You might want to get rid of the wp_die() call altogether, or place that call at the very end of your function, depending on your needs.
Other than that, try determining whether your function is called at all (might be something wrong with the AJAX call itself).
Related Posts:
- Trying to establish connection to External Database
- Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder
- How to return number of found rows from SELECT query
- $wpdb->delete column values IN ARRAY()?
- WPDB: how to get the value of a field in a custom database table
- Prevent Data Resubmission On Page refresh
- Any possible way to make $wpdb->get_results() return anything else than array?
- database interactions using OOP
- Display fields as values in array from external SQL DB
- Getting id of poll from WP database
- WSoD being caused by this piece of code
- $wpdb->update with multiple parameters gives error
- Update results, Before deleting the related category [closed]
- How WordPress reacts to a lack of memory of the server [closed]
- Display Data in Table from External Database in WP using Shortcodes
- How to retrieve the data from the sever and displaying it in a page?
- I can’t update my data through $wpdb
- wpdb Cannot Update column in Database
- How to use mysql LIKE with wpdb?
- Delete database record using plugin from admin panel
- Wpdb get->results to out the the month from the db
- How to add data to a custom field at the wp_users table?
- Change MySQL PDO connection to a WPDB connection
- WPDB – Read and write value from / to database
- How to Generate a list of Most Commented post?
- Add row to custom database Table and delete all rows older than 1 day
- select a single val though a table in wordpress
- SQL error with custom query
- Add posts to custom table in database instead of wp_posts
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- Database entry removed on browser refresh, Ajax PHP jQuery
- Change wordpress’ database data using ajax – how to get current user id?
- Create a new account on site B with data from the purchase of site A
- Using wpdb to connect to a different database is not working
- Modify post image in full size
- How to grab data from input and store it into custom table in database?
- Accessing external database: ERR_INCOMPLETE_CHUNKED_ENCODING
- Weird Behaviour: Not all WordPress Posts appearing
- How to fetch results from database
- Check if values exists DB
- Querying multiple meta_keys in WordPress SQL query
- MySQL database migration to WordPress
- Fetching wpdb data from a php file seems to break?
- Insert into db with foreach problem
- posts_clauses drop ACF get_field function
- How to get data (not value or name) from radio options to POST to database
- Putting form result in my database
- How to deprecate a function used in a plugin?
- How to make a image-size selected by default in Media upload – WP v3.5
- Hide main div if wp_nav_menu is empty
- How to check if image is already stored in a site’s post database? (network)
- Removing Default Gutenberg Blocks, But Keeping Reusable Block Functionality?
- How to draw media details for Isotope gallery using Photoswipe
- Add Useragent to the body class?
- How to override an unpluggable parent theme function?
- Changing user_nicename
- Remove wp-mediaelement.css from wp_head
- add_filter to post-gallery and remove all ‘s?
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- Can i check if user is doing any ajax request?
- Displaying post per day
- How to Populate the list of custom post type categories
- Php string not working in WordPress Functions.php [duplicate]
- show limited tags in an article
- delete an array element when its date expires
- Understanding WordPress child theme custom JS loading
- Problem with ACF shortcode with Repeater Field in WordPress? [closed]
- Why is PHP Cookie via plugin only set when logged in as Admin and not regular users? and other questions
- Insert After Second Paragraph Without Tag?
- Using a function written in my functions.php file within the header.php file
- Disable External Pingacks on WordPress Posts and Only Allow ‘Self Pings’
- Create an array from an array
- Woocommerce: Is it possible to overide the settings for allowing to purchase out of stock products [closed]
- Can I change a variable in a content part while calling it?
- javaScript in section of WP API
- WordPress Redirect: Default Password Reset URL [duplicate]
- Ajax $wpdb not returning table data
- Shortcode return function with link href inside PHP
- Removing unneccessary p-tags (Not every p)
- Function not working at one place
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Can’t get wp_insert_post to work
- Showing content from one page on another
- I want to select the from values from database in WordPress? [closed]
- only show container with next/prev links if they exist?
- Populate dropdown with Child Pages based on Parent Page chosen
- How can I remove a function that has been added to wordpress with add_filter?
- Get value from shortcode to do something
- PHP 8, AJAX mail form to function.php doesn’t work
- How does WordPress know wich language is chosen when there is a database connection error
- JS file work only in index page
- Ajax request not sending to server and returning – wp-admin/admin-ajax.php 400
- Error in custom php function doesn’t exist
- Custom shortcode outputs plain text instead of HTML at top of post
- how can i use $_COOKIE[] + PostID to execute the below code?
- What’s the uses of wp_cache_set() or wp_cache_add()?
- How to create a php variable using WordPress the_title() function
- Create Page To Count Comments For Each Post In WordPress Site
- Can’t find infinite loop cause
- how to make custom ajax handler?