You should not try to do it. Direct access of php files which are not in the root directory might be blocked for security reasons.
what you need to do is register a settings page for your plugin and add into your forms some hidden field that indicates what kind of processing you want to do on the $_POSTed data. Then use the URL of the settings pag as the action url for the form (use admin_url
to calculate it).
Side note: always try to avoid relative urls in wordpress forms. It is too easy to end up with the form at a place where the relative url points to nothing.
Related Posts:
- Catching Form Submission in WordPress Admin Panel
- Post data in wp-admin to external database
- How can I add an image upload field directly to a custom write panel?
- Is it possible to reuse wp.media.editor Modal for dialogs other than media
- How do i best handle custom plugin page actions?
- Plugin Form Submission Best Practice
- $_POST form request with admin-post
- How do I improve this admin query snippet to avoid generating duplicate results on non-meta searches?
- Plugin API for easy admin list table generation, handling & exporting of MySQL tables?
- Handling results from data hooked into admin_post
- Export data as CSV in back end with proper HTTP headers
- What is the real intention for admin-post.php?
- Completely remove WP_Admin_Bar for specific user roles
- API to trigger prompt on leaving page
- What is the recommended way to create plugin administration forms?
- Show message on wordpress admin dashboard
- Hook the Keydown Event in the TinyMCE Post Editor
- Is it possible to add an admin page using add_submenu_page() and pass a var in the query string?
- how to use thickbox in admin?
- How do you create a custom edit.php / edit pages page
- Cancel post save
- Add a jQuery function to admin pages
- Using AJAX in a plugin to submit form – REALLY confused
- Is it save to require plugin.php early to be able to use get_plugin_data() earlier?
- WP Cron doesn’t save or in post body
- Create a clickable name in WP_List_Table for Plugin Admin
- Filters ‘request’ and ‘parse_query’ not firing in sites.php nor link-manager.php
- Post from front-end with post types, categories and taxonomies
- URLs of plugin resources?
- Front-End Form Submission in Shortcode
- Check spam in custom form – akismet
- Use a PHP file as action for a form in a WordPress plugin, what’s the correct way?
- Problems with removing admin bar
- Check if I am in the Admin Panel (wp-admin)?
- How to add custom content under plugin row in WordPress admin plugin list?
- How to put placeholder text in the main post input area?
- Front-End Interfaces Without Shortcodes
- Best Practices for Creating and Handling Forms with Plugins?
- How to load the plugin only when logged in?
- How to redirect to action on custom page within admin section
- Plugin options page – form with two different submit buttons
- WP AJAX is not working, always returns 0
- Add notification bubble notice in navigation using transients
- Can I individually style items in the backend widget list?
- How to run a external JavaScript file on wp-admin if admin, and other if normal user?
- How to sanitize user input?
- add a class when login
- Add a panel to edit post
- Where should I put “run once” plugin pages?
- Using the default wordpress uploader inside plugin
- Modify users.php page to create page/post on button clicked
- Issue plugin commands in admin settings page
- Any problem in using native jquery ajax style instead of using admin-ajax.php?
- maintaing consistent layout wordpress dashboard
- Replacing Scripts in Admin Load_Scripts
- Programmatically modify an admin page UI of a WordPress site from my WordPress plugin
- WooCommerce registration password field not displaying
- wordpress plugin php file processing form
- Problems with: manage_${post_type}_posts_columns
- How to add custom fields to the all users page
- Global State During an Admin Post
- Render content after post title in wp-admin
- Error on inserting a form value to database
- On cliking add new post redirect user to a custom page first
- Multiple options pages validation for a plugin
- What should happen when a WordPress Plugin is activated across the network (Network Wide Activation)
- Form doesnt save to database
- Prevent third party plugin’s admin page access based on user type
- How to add WordPress Admin “Insert Link” UI (searches through existing posts for URL) and functionality into a custom plugin?
- Is it possible to restrict all admin pages except theme customisation and storefront using plugin?
- Admin – Handle data before creating or updating a post, page or custom post
- wp_filesystem put_contents issue with owner/group
- Password field is empty when using wp_signon();
- How can I replace content in the WP Admin area before an admin page is rendered?
- Create custom HTML/JS app inside page
- Plugin Development for registered users
- Is there documentation reference for forms in menu and setting pages?
- Using ReactJS in the WordPress admin for plugin development
- Input in plugin widget does not allow spaces
- template_redirect or admin-ajax.php?
- Creating Admin Plugin – Content of a page is displayed at global scope as well
- How to load library scripts in admin from plugins in noConflict wrapper?
- Show error message after exception handled
- Avoid updating post when sending POST or GET request to post.php
- Issue with contextual help overwriting existing content
- Enqueue script globally
- Alternatives to DISALLOW_FILE_EDIT wp-config Constant? It Breaks Some Plugins
- How do I add a favicon that only shows during viewing of my plugin’s admin panel?
- admin_post equivalent for guest user?
- How do I link to a php file in my plugin directory?
- WordPress Admin Login Custom Logo
- How to create custom settings page for custom plugin
- 400 Bad Request, in wordpress theme development, wp_ajax
- How can I add a simple custom field to my plugin?
- How to import the css in the plugin admin area?
- Creating multiple wp_editer() text fields in for loop — the text/visual switch only works for first editor
- Displaying “One Time” Notification in Plugins
- Run JavaScript validation script on form submit in plugin
- I am unable to save my data from a form
- Wp-admin Custom User Management