How can I retrieve $_POST
data in the WordPress environment that comes from my external application(native PHP)? The external application was submitting a form and redirect it to WordPress.
To be more specific, I am working on integrating my WordPress site with another application that has my user database and would like to create something like login with XXX. So I wanted to retrieve the $_POST
data that submitted from that application into my WordPress and manage the authentication from WordPress.
I tried to print $_POST
inside my themes functions.php
, it does not show the data at all. I even try with $_REQUEST
but to no avail.
I won't be able to use wp_remote_post
because there's no URL to be used in arguments and this is not an API call either.
Below is the code I write in my functions.php to print the $_POST
data that submitted from my another application. I used shortcode
to view it in the front-page:
<?php
function view_post_data(){
echo"<pre>";print_r($_POST);
}
add_shortcode( 'print_it', 'view_post_data' );
?>
Any best practice for this?