In most cases you shouldn’t access your plugin’s PHP files directly. By itself file is just a file, it has no way of knowing it is part of WordPress installation. Even purposely loading WP core from arbitrary file is very challenging to do in a generic and reliable way.
What you should be doing is pointing your form at one of WordPress endpoints and using hooks to connect your code to it.
For simple form submission you probably should start with studying wp-admin/admin-post.php
endpoint and trying to make use of it.
Related Posts:
- Is there a plugin that will override the “Error establishing a database connection” message? [closed]
- Making my plugin multi-site compatible
- How Can I Securely Implement a Password-less Login Feature?
- Syntax highlighting for post/page editor [closed]
- run silex or slim with wordpress
- Ways to have multiple front-page.php templates that can be swapped out?
- How to track hits of a single media file?
- How to create a WordPress plugin for another wordpress plugin?
- Admin menu as submenu from another plugin
- How Is Network Activate Different From Activate (by Implementation)?
- Shortcode output appears before post body [duplicate]
- Automatically Creating Posts for Popular Forum Topics or Products [closed]
- use WordPress theme / plugin editor in my plugin
- WP Config for FTP credentials
- What is the best way to output plugin result in certain url
- How to call shortcode function directly and pass $atts
- Plugin Development: WordPress processes twice on post update. How to skip process on the first?
- Multi step form, custom plugin
- This doesnt work for Plugin get_template_directory_uri()
- How do I prevent Plugin updates from clobbering user edits?
- Contact Form 7 plugin refreshing page on submit [closed]
- Some Plugin Settings Are Kept After Removal and Reinstall of the Plugin
- WordPress hook for visiting a post
- why does the add_action(‘the_content’) overwrite my page
- Fatal error: Class not found in
- Is it ok to call get_option without hooks?
- Send emails with wp_mail() using SMTP configured in plugin
- Show “Local Pickup” shipping method only for specific Woocommerce product categories [closed]
- What user roles should have wp_unique_post_slug_is_bad_flat_slug filter applied?
- Can I check plugins and themes for PHP 5.6 ahead of global PHP server Update
- How can I reuse the WordPress search form for a custom plugin / widget?
- Where should a plugin or widget cache its results?
- Set of plugins to control the Admin UI
- How to transfer all user data between wordpress installations?
- Appery.io and WordPress
- Plugin upgrade issue
- Simple ajax call not working in wordpress plugin
- __callStatic method handler passed to add_action causes bug in PHP
- Multiple instances of nivo slider plugin
- How to use wordpress $polylang->model->set_post_language in custom php code?
- New databes tables with – WooCommerce – for developers [closed]
- Interactive filters on wordpress [closed]
- Plugin-generated pages use Not Found or Pages Archive templates?
- Add padding while generating thumbnail
- Using TinyMCE in plugin?
- ACF only showing up in Homepage but doesn’t appears in all pages
- One file for all translations
- Send admin an email when a user’s search has no results
- How to Loop Through all Posts and Count Attachments using Get Media Attachments
- custom post type don’t appear in the home page
- Shortcode not working after move wordpress website files
- Contact Form 7 – Form name blank [closed]
- Remove / overwrite some functions in buddypress.js
- plugin dev – minimum base css specificity?
- Help with comments.php
- OceanWP settings are missing from Add New Post [closed]
- Creating a functionality plugin to edit seriously simple podcasting
- in source code but I can’t find it in files or plugins
- Historical customisations won’t go away [closed]
- Loop returns the current page’s permalink and guid instead of the post in the loop
- display connected User to post
- Plugin upgrade failing during unzip
- How to add credit card validation check to wordpress [closed]
- Get access to WordPress when logged out
- How do you add a settings page to another menu?
- What plugin should I use to add Microformats to my blog
- Any way to change WP-PostRatings so you can only vote up?
- Plugin or ways to limit number of users logging in the website,
- Replace old theme that understand old css (vcex_icon_box css_animation)
- WP Ajax DB issues
- ACF checkbox return format based on page
- How do I add a medium to the WordPress database with my own plugin?
- How to get database connection details without longing to cpanel in WordPress?
- Loading a plugin in a post template without using wp_head()
- How to translate wordpress blog to other languages?
- Hide response returned from WordPress REST API call
- Uncaught TypeError: Cannot read property ‘cycle’ of undefined
- WordPress drop domain alias
- Store admin page into variable
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- WP Plugin CSS not being applied to page
- Unable to sync woocommerce variations
- Plugin does not create a custom table upon activation
- Changes required to make new plugin from existing
- WordPress Development understanding core
- Input gets deleted/overwritten after changing to different Admin Menu
- Redirect loop when forwarding to mobile site
- Server Path Information
- Drop down menu location select widget
- Cannot Search | Featured | Popular | Newest | Favorites in wordpress working
- Most visited posts
- Need help finding the right plugin for a dynamic piece of content that appears multiple places
- Thumbnails and Lightbox
- Integrate Mailchimp to a Contact Form 7 contact form [closed]
- Applying a coupon to a single product in woocommerce [closed]
- Plugin installation works only with FTP – how to debug?
- How to create a custom wordpress plugin for a specific functionality?
- Override the plugin class and function
- I want to display data last 7 days with date wise in chartjs?
- WP FULL CALENDAR (NO NEXT ARTICLES DISPLAY)? [closed]