you can use something like this:
add_action( 'admin_post_add_foobar', 'prefix_admin_add_foobar' );
//this next action version allows users not logged in to submit requests
//if you want to have both logged in and not logged in users submitting, you have to add both actions!
add_action( 'admin_post_nopriv_add_foobar', 'prefix_admin_add_foobar' );
function prefix_admin_add_foobar() {
status_header(200);
die("Server received '{$_REQUEST['data']}' from your browser.");
//request handlers should die() when they complete their task
}
Related Posts:
- Is it possible to filter the wp_footer() scripts, read the content, and insert them inline?
- ACF Taxonomy search on backend (Relationship field)
- How can i see/log all requests coming from a registration form (not from the UI)?
- How MUST the directory for a plugin be structured?
- Is there a WordPress plugin that registers a plugin file as a custom page template?
- SSL redirect loop using WordPress HTTPS Plugin
- InDesign to WordPress workflow
- Preventing a plugin from updating
- How to Check If A Plugin Is Enabled Through API?
- Using nextGen Gallery.. how can I call a list of all Gallery Names?
- Is there a way to display Woocommerce nav filter widget filters for shop page in all headers?
- WordPress widget / plugin….fields not appearing in my widget
- How to send “Location” header on plugin form submit event?
- What is $tab in `install_plugins_{$tab}` hook?
- Gurenberg Block: How to migrate from el-Functions to JSX elements?
- How to install WordPress Multisite with different domains under the same subdirectory?
- WordPress roles – Protect administrator role
- Language Translation is not working?
- Enable/Disable WP options programmatically
- Could not create directory
- Plugin is available to update when its not
- Passing $this->get_field_name() to javascript
- add_action in functions.php, do_action in plugin?
- Is there a plugin to insert pre-defined link into editor?
- audio streaming plugin but with no save option?
- Missing argument 3 for wp_register_sidebar_widget()
- Read text defined under __()
- Plugin Customization Lost During Plugin Upgates
- Plugin activation hook in an abstract class
- How to make my plugin able to be updated from admin panel?
- Shortcode button dosent work for all posts. Work for first post only
- How to make wp_enqueue_style and wp_enqueue_script work only on custom post type
- Is there a way I can find wordpress posts that don’t contain a word?
- Single central login for front end users from any site
- Plugin stable tag on wordpress.org not updating
- Generate XML Sitemap for Blog on Magento Platform
- Plugin Handle URL With Custom Theme
- how to disable blockrenderAppender inside all Innerblocks?
- Can I use custom CSS and js plugin to put JavaScript in to validate my forms
- Redirection of users away from wp-admin (but not administrators)
- Cannot find a list of data selectors for Gutenberg editor
- auto populate list of questions if user select a category xyz
- Change commission_status paid when withdraw_status vendor is completed
- WordPress Plugin [closed]
- Lock access to plugin options
- Get errors from WP_Error to different variables
- Call specific plugin update
- How to get post ID with hooks publish_post, new_to_publish, etc
- Prevent plugin from intruding on wp-json posts api
- What happens when WordPress memory limit is exceeded?
- Some WordPress Posts are automatically becoming comments on other Posts
- Always get creating a new table with foreign key
- Best way to duplicate specific page content across two sites?
- Search users with custom meta data
- How to change layout of shop page in wordpress? [closed]
- If post exists in the database – each time goes on `else`
- How can I achieve this, using shortcodes
- Woocommerce Product Page edit “from” text [closed]
- Multiple images per post – Show random image elsewhere
- Edit part of a post
- Display hReviews from other websites such as yelp on your site?
- Sociable buttons displaying seemingly at random [closed]
- How to fix these PHP Warnings with the “Feed JSON” plug-in?
- How to Join wp_posts & wp_postmeta table using custom query
- Use localized plugin name and description even when the plugin is disabled
- how to show new field if option selected?
- Give custom page template a custom post ID
- Randomize post (and page) IDs on generation
- Any tips for a plugin to define specific pages navigation for specific types of users / members? [closed]
- Cron task gets removed from the schedule
- My wordpress local urls is still displayed even moved to live
- How to store a custom theme and update it on other installations
- How to Unhook actions/filters in within Class in plugin
- One time call to external API in widget
- Hide Featured Image in AMP
- get_posts query results out of order but shows correct in php snippets plugin
- WordPress filter from custom table is not working properly
- How to show private pages based on a user’s role?
- How to restrict the user from viewing comments but with option to write comments?
- Dynamically Modify s2member Options
- WordPress scheduled event not working
- What action/hook do I need to register to have my plugin handle front-end editing?
- Plugin with AJAX on subdomains causes 404 in console
- Do something with thumbnail image on post publish
- Create csv file in plugin
- Option page not updating multiple records in settings api
- WordPress plugin addon [closed]
- Displaying saved category checked in a plugin?
- The plugin generated XXX characters of unexpected output…help?
- Using “Authy Two Factor Authentication” in custom login page
- Thumbnails have stopped generating correctly
- Managing database tables in WordPress multisite
- get_posts() method and paging is not working
- WooCommerce doesn’t show UK countries in the shipping options [closed]
- plugin for different writers [closed]
- What is the source outline for a basic word press plugin?
- WordPress Site in Multiple Languages
- How to edit a non logged in page?
- Woocommerce Product Page Collapsible Box Using CSS
- Different login and logout for wp-admin while using buddypress