Hi @Mild Fuzz:
Sounds like what you might be looking for is the template_redirect
hook. If you add a function for that hook then you can output whatever you want and end with an exit;
statement.
add_action( 'template_redirect', 'yoursite_template_redirect' );
function yoursite_template_redirect() {
if (isset($_GET['foo']) && $_GET['foo']=='bar') {
// Do whatever you want when $_GET['foo']=='bar'
}
}
You’ll need to figure out what criteria to test for such as I showed with $_GET['foo']=='bar'
, but is that what you are looking for?
Related Posts:
- What’s the preferred method of writing AJAX-enabled plugins?
- How to pass JavaScript variable to PHP in wordpress widget?
- AJAX Call Via Vanilla JavaScript In WordPress Plugin Development
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- Execute a function using ajax
- Errors while using ajax from external wordpress page
- Built in admin ajax hooks?
- Ajax call doesn’t work in frontend but it’s working in backend (when I’m logged in)
- Why is my ajax call refreshing the page?
- Admin-ajax.php is dying “0” without processing function
- how to use ajax to display from database and load more in wordpress plugin
- How to remove an Ajax action
- How to create popup same as wordpress popup feature
- Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]
- $wpdb working with ajax but showing ajax error instead of success
- Ajax gives 400 error
- Check if email address exists front end with AJAX in a plugin
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- WooCommerce get_price returning wrong price when used via ajax
- Simple ajax call not working in wordpress plugin
- AJAX search posts and pages
- __callStatic method handler passed to add_action causes bug in PHP
- Using a custom plugin to capture input data via Ajax and PHP
- Ajax contact form widget plugin data not insert in database
- Best place for if/else piece of code related to custom plugin?
- Ajax call returning 0
- Create tabs in admin options page from custom post type loop
- What are the Best Practises When Using AJAX in Plugin Development?
- Admin AJAX doesn’t work in plugin admin page – Even though code is copied verbatim from WordPress Codex
- Submit Form data to another page via Ajax (WordPress Way)
- WordPress front end AJAX. Return 0 :?
- Using WordPress to build membership Page
- Asynchronous request in wordpress
- Is there a better way of handling AJAX requests in WordPress?
- WordPress API functions not working at AJAX functions.php call
- Calling a class method instantiated by ajax call in wordpress [closed]
- Ajax request sends url rather than data
- can’t unzip file
- wp_query ‘s’ parameter does not work with WC_AJAX
- wc_get_template_part doesnt display the content [duplicate]
- Error datatable whit ajax
- How to use Datatable with Ajax when creating plugin on WordPress?
- AJAX update fails for public/non-admin users
- WordPress Ajax request “Failed to load resource: the server responded with a status of 400 ()”
- WordPress ajax error 400 bad request for sending data to remote site [duplicate]
- ajax voting for custom post type
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- Overwriting Plugin’s Ajax callback function from theme
- My ajax request don´t work and return 0
- WordPress environment not loading properly
- wordpress ajax pagination object value does not change
- How can I use wp_ajax_response for front-end error reporting?
- How to limit each front-end user to view just his own uploaded files on Amazon S3?
- WordPress ajax not working in registration
- What’s the preferred method of writing AJAX-enabled plugins?
- Ajax, jQuery and WordPress
- How to get site homepage from plugin?
- Capturing POST data
- Help me with my first very basic plugin
- Load css classes after using ajax calls
- wordpress Ajax success doesn’t return the value
- Jquery post responses 500 error after some time and lastly an 503 error
- Inline AJAX script passing variables to PHP
- wordpress admin-ajax bad request 400
- How to structure a plugin
- dealing with large HTML output via plugin code
- Is There a WordPress Hook to Filter the Edit Posts View?
- Plugin stability | Using a plugin VS Developing functionalities yourself
- How to Create a Directory in a Plugin Folder?
- Declaring script dependencies between scripts enqueued with different action hooks
- Does flush_rewrite_rules() remove all rules added by other plugins as well as mine?
- Custom preview_post_link not working for draft post
- How to use get_theme_mod in gutenberg editor wordpress?
- Correct way to perform non-cacheable DB query
- How to handle cookies from a WordPress plugin on a cached page?
- Adding CSS to custom post type admin page causes error
- Create shortcode to echo javascript
- How to add apply_filter for a class property in plugin
- wp_list_table class is not safe to use
- creating a plug in that would tap into save/update action of posts [closed]
- Content-Security-Policy Headers are there and showing the correct settings, but still getting a refused connection
- SMTP Error: Could not authenticate [closed]
- How to delete all categories programatically?
- How to use custom Javascript code inside a plugin?
- WordPress subfolder installation AJAX Problem
- Adding submenu to custom plugin menu page created with add_menu_page() function
- What is necessary to secure a WP plugin against direct file access attempts?
- Add a Custom Field in Comment Box next to the Text area
- How do you create a re-useable HTML fragment in wordpress
- Translation for a text that is not printed on the screen
- Two plugins using the same CSS id
- Activation flow of a plugin in a multisite environment
- How to call a function from class in wp table list button form
- Overwrite js code using WP_Footer
- Ajax call to php function doesn’t work PHP code
- Frontend AJAX Request causes Error: ‘Call to undefined function add_action’
- How to access classes in theme of a plugin?
- Need to hide an element depending on date and post category
- Using Taxonomies with Vote It Up plugin chart [closed]
- Change weird Wp File structure