You can check for the presence of a specific query variable, so http://www.example.com?my_listener=test
. You check for this on the init hook and if it isn’t there you just quit early and WP goes about it’s business. If it is there, you can then do something, just don’t forget to exit at the end or the full page loads and that can mess up the response you are trying to send to your app.
function wpa_91930() {
// if query var is not present just return
if ( ! isset( $_REQUEST['my_listener'] ) || 'test' != $_REQUEST['my_listener'] )
return;
// send response
echo "it works";
// don't forget to exit when you are done
exit;
}
add_action( 'init', 'wpa_91930' );
Related Posts:
- What’s the difference between home_url() and site_url()
- Prevent “main” WPMU site_url() being returned in functions
- Custom page with variables in url. Nice url with add_rewrite_rule
- Is it possible to use a forgot password url filter?
- Create Custom URL structure for specific Post category
- How can I rename the WordPress AJAX URL? [duplicate]
- Ninja form Redirect depending on text field content [closed]
- wp-comment author- url +, email filter hook
- Removing custom meta data
- WordPress on AWS Auto scaling and ELB giving 503
- WordPress converts media extention URL automatically to video player
- meta tags doesnt fetch data from permalinks
- Get arguments from URL
- Add unique id to Preview URL
- How can I set the SRC URL of the custom logo image?
- Need to convert image url to a Base_64 data url with wordpress function..
- Protect get_query_var from manual input in url
- Problem with images URL after filter applying
- How i can get the URL?
- include w_thumbnail_src in function?
- Create Custom URL structure for specific Post category using Post ID instead of post name
- Fetch URL parameter
- how can I change all wordpress media file url to custom cdn url?
- Custom route and extract data from slashes and parameter
- reWrite wp-content url to point on my cdn
- How to Override Page Template if URL matches query?
- Add #primary at the end of navlink permalinks on single posts
- Set URL Parameter Post Layout As Default
- Using Switch Statement to Change Image According to Last Digit of Topic ID
- Instead of using $post, how do i get the thumbnail image of the $post
- How to add a meta information to the URL?
- How do I change the URL returned by next_posts_link()?
- Ajax call always returns 0
- Is it ok to use a function to output the text domain name in a wordpress theme
- How to override a function when isn’t at functions.php
- contactform7 remove tags with “wpcf7_autop false” from functions.php
- How to count number of functions attached to an action hook?
- Show modified time if post is actually modified
- ajax live search for post title
- Hourly Routine Not Firing ( wp_schedule_event() )
- How to get an array of menu items from the toolbar?
- Fatal error: Call to undefined function add_action() – an untouched problem
- echo or print_r in an admin function
- Automatically Add Specified Value to Attachment Metadata upon Upload
- Twenty Eleven Child theme error when attempting to use a rewritten function
- List of Body Classes Generated by body_class()
- is_dynamic_sidebar always returns true while using Jetpack visibility
- wp_trash_post function to only apply to posts, not pages!
- Redirect specific page in WordPress for first time visit
- Adding widget to dashboard with wp_dashboard_setup not working
- qTranslate in functions.php
- Using Schema with `the_excerpt`
- Image rotation fails to regenerate custom sized thumbnail
- Register and load scripts
- Display alert on successful user Sign Up
- Getting different functions data while using while loop in wordpress
- How to rewrite the custom url in wordpress?
- About cron delete user with meta_key
- Set spesific size of featured images
- Getting comment count per post not working
- Functions.php Problem
- edit formatting.php in a theme so it wont get overwritten
- add_action template_redirect not working for home page
- Excerpt for pages not showing
- Can’t Write Custom Widget Code In One ECHO
- Got white blank page after copying the functions.php to child theme
- Insert nofollow in a “Powered By” link, except in the homepage [closed]
- Image loading function not working on archive.php template
- what is best way to keep track of changes made in wordpress website? [closed]
- Is this an acceptable practice for WordPress theme development?
- Add a class to post if it has been recently updated
- how to add_filter to non hook function
- WordPress comment processing . Default unapproved comments detection before posting
- Custom image sizes showing in Classic Editor only when upladed directly to post
- Members only function, but allow account activation [solved]
- Allow logged in user to view a Page, else send to login screen and then redirect back to Page
- Appending „read more” to the excerpt conditionally
- Why is the term of my current page not returning a slug?
- Override plugin function to show invoices even if not logged in
- How To Display Author Popup on Entry Meta (Genesis Framework)?
- Serving cache from multiple domain names
- Fatal error: Call to undefined function. Underscore me
- Why am I losing image quality on my site?
- Replace image attributes for lazyload plugin on image elements with specific class
- Custom shortcode with do_shortcode and substr
- Keep js after reload the page
- How to run a function when publish posts? [duplicate]
- What is wrong with functions.php? Fills error log with same error
- Function returning queried meta value based on current post ID
- Adding custom field in menu options [duplicate]
- Function the_content
- Edit TinyMCE Button Functionality
- How to add a piece of code in function
- Automatically delete posts based on query
- Dynamically adding Captions to images
- Run function from parent on child site
- Search Woocommerce product titles only
- How do I make my child theme’s CSS update when I save it?
- Bulk set Post Title as Tag where Tag is Empty Function
- Problem with removing characters “<” – WpAllImport