You’re POSTing the form to the validate.php file directly, so the WordPress code isn’t loaded. Instead you need to POST the form to the current URL or the home_url or something like that, and then have the plugin intercept the data and act accordingly, so that the WordPress code is loaded before you use its functions.
Related Posts:
- Redesigning Custom Post Type “Add New” page
- Can we hook a static method of a class to add_action inside that class?
- How can I remove a hooked action created by a plugin?
- How can I add a custom header to a custom template in a plugin without using the theme folders
- Twillio How To Send SMS for Custom Post Type
- Woocommerce category description as subtitle
- Custom values are not translated
- Change the name of an installed plugin
- WP deregister, register and enqueue dequeue
- prefix table and plugins
- Remove action from a plugin class, forced to use global instance
- Duplicate a Multi-Site Subdomain
- why in my wordpress admin panel the membership option is not showing
- What Plugin Do You Use to Turn WordPress based site to A Blog Aggregator
- Sanitizing, Validating and Escaping in WordPress (Plugin)
- Error uploading plugin zip file
- Avoiding Duplicate function names in Post Loop (WP_Footer script)
- How to add page using HTML, CSS and JS?
- problems with wordpress and php version 5.3.3-1
- My Category is too big on the Menu what can i do?
- Integrating non-WooCommerce and WooCommerce Orders together [closed]
- Hook to plugins admin settings
- Fusion Slider Just keeps loading [closed]
- how to change the verification url of pie register plugin of wordpress?
- (WooCommerce) Remove Sidebar only on Single-Product page
- Own plugin corrups plugin-activation
- stack-overflow-like content ranking for wordpress?
- finding whether request is for post, and post id
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Owl Carousel2 image not displaying full width when using Stretch row and content, Stretch row and content(no padding) in wordpress
- WpDataTables – View Image Directory
- Masonry images not working
- How to block XML-RPC attack?
- How generate 200% image size and save with suffix @2x
- Force language in translate function
- Using color picker in plugin, does input attribute order matter?
- Can’t send mails wordpress using SMTP authenticate [closed]
- Some recent plugin updates have failed “Could not create directory”
- How do I apply style to each category of a list?
- How do I combine a theme with a plugin
- Use wp-config.php constants in all files of plugin
- a href adds default URL with the given echo URL
- How to track clicks
- How to install Google Analytics onto site without internet access
- WP.org acceptable iframe alternative
- Access post title from custom meta box on title change
- Add to array, redirect and display
- how do I secure my WP website from hackers? [closed]
- How to add a WordPress Nonce for this form to avoid CSRF
- Function call in wordpress short code handler fails
- Overriding current theme files via plugin
- How to create a plugin that includes all the other plugins?
- Mowing site to another domain in simplest way
- ACF – How to set the menu order for the relationship field
- Passing PHP Variables to AJAX Loaded Pages
- How to check for completeness when upgrading fails and stuck in maintenance mode
- Remove border attribute from Pin It Button image to pass HTML5 validation [closed]
- Manage PDF downloads and protected pages
- How to restrict a plugin from certain pages without editing its core
- Hooks to run after a core upgrade?
- How do I override all stylesheets and scripts without a plugin
- How to permanently show Word Counter on Create/Edit Page. WordPress5.9.3
- how to move a plugin-block in Edit Post page back to bottom area?
- How to change my 3000 Published post status to Draft using PHPMyAdmin
- Show popup on click
- Search results to point to specific section?
- Adding an item to an anonymous array inside a filter?
- add menu page not showing Icon
- Make custom post types using ACF
- Using id to show item
- One quantity for group of variations
- WP Migrate DB Pro plugin cannot transfer Media files to remote server
- Shortcode and WP query using category attributes
- URL Rewrite 404
- Plugin for showing single product on a page
- Is admin section completely customizable in terms of styling?
- Custom Gallery plugin uploading to different dir, and post to page
- Better way to run heavy scripts using WordPress database
- Taxonomy question
- What’s a good way to default behavior if a plugin is inactive?
- how to check plugin name unique or not?
- Pause form submissions while upgrading plugins
- How do I locate specific part of code that affects ssl?
- Render Shortcode in Lightbox Gallery
- Redirect login url
- Disable plugin on admin page
- WordPress ajax not working in registration
- Publish Post but don’t call publish hook in foreground post creation
- WordPress Overrides folder permissions in Cpanel
- Replace code in plugin template
- Setting META tags such as description and title on programmatic post creation
- How to Set Limit with WordPress Get Bookmarks Shortcode
- making users able to add their own products wp e-commerce [closed]
- Selling Downloadable Products [closed]
- ACF: Hide a div or template section when a custom field (in a field group) is empty
- TypeErrors with Yoast, jQuery in conflict?
- Adding a variable to a meta field in the backend?
- Creating a Table Row by Row
- Getting 504 Gateway Timeout Error on AWS Server! [closed]
- WordPress issue – data is not showing in wp-admin, but when searching through database, all the data is there