Proper way to handle GET and POST request in WordPress

Last Updated: January 28, 2020

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<?php
add_action('init','handle_your_reqest');
function handle_your_request(){
if (isset($_REQUEST['your-key'])):
// Your Code Here
exit;
endif;
}
<?php add_action('init','handle_your_reqest'); function handle_your_request(){ if (isset($_REQUEST['your-key'])): // Your Code Here exit; endif; }
<?php
add_action('init','handle_your_reqest');

function handle_your_request(){
    if (isset($_REQUEST['your-key'])):
       // Your Code Here
       exit;
    endif;
}

 

Add your feedback or comment below: