WordPress Process $ _POST Inside Analysis Request

I am writing an application to receive and process an instant payment alert message in Wordpress. This is a POST request made for a "virtual" URL with rewrite rules. However, the problem is that only GET vars are available, I cannot access the post variable:

And: Result in an empty arrayprint_r($wp->query_vars['ccustfirstname']);
print_r($_POST);


I modified the existing code to fit my case:

function ao_add_rewrite_rule() {
        print_r($_REQUEST);
     $ipn_parameters=array("ccustfullname","ccustfirstname", ... );
    foreach ($ipn_parameters as $key => $value) {
    add_rewrite_tag("%$value%",".");    
    }

  add_rewrite_tag("%arevico_api%",".","");
  add_rewrite_rule( 'ipn', 'index.php?&arevico_api=ipn', 'top');
  add_rewrite_rule( 'hoplink', 'index.php?&arevico_api=hop', 'top');
  add_rewrite_rule( 'pay', 'index.php?&arevico_api=pay', 'top');
  flush_rewrite_rules();//TODO: call only when needed
}

add_action( 'parse_request', 'wpse9870_parse_request' );
function wpse9870_parse_request( &$wp )
{   

    if (!empty($wp->query_vars['arevico_api'])) {

        switch ($wp->query_vars['arevico_api']){
            case "ipn":
            print_r($wp->query_vars['ccustfirstname']); 
            print_r($_POST);    

            die();
        //  require_once(AREVICO_PLG_BP . "ipn.php");
        //  $ArevicoIPN=new ArevicoIPN();
            break ;

            default:

            break;
        }
    } 
    return;
}

      

Note that the getvico_api get parameter gets trough, but the POST parameters don't. I am testing an application by sending sample data via Simple Rest Client for chrome. How to access publishing options

+3
wordpress wordpress-plugin rewrite


source to share


No one has answered this question yet

Check out similar questions:

538
Can I install / update WordPress plugins without providing FTP access?
380
Fix file permissions for WordPress
226
How to add a PHP page to WordPress?
4
Wordpress: How to convert generated url (permalink) to nice url?
3
Wordpress add_action inside another function
2
Customize the Wordpress login process
2
Wordpress-Cancel the process of saving messages
1
Wordpress form does not process $ _POST data
0
getting $ _POST variables in wordpress
0
Handling $ _POST in Wordpress



All Articles
Loading...
X
Show
Funny
Dev
Pics