Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. add_action( 'rest_api_init', 'custom_api_register_with_email_route');
  2.  
  3. function custom_api_register_with_email_route() {
  4. register_rest_route('custom-api/v1', '/register/', array(
  5. 'methods' => 'GET',
  6. 'callback' => 'custom_api_register_user_with_email'
  7. ));
  8. }
  9.  
  10. function custom_api_register_user_with_email() {
  11.  
  12. $input_values['input_1_1_3'] = 'mike';
  13. $input_values['input_1_1_6'] = 'geek';
  14. $input_values['input_1_13'] = '12345678';
  15. $input_values['input_1_3'] = 'ram';
  16. $input_values['input_1_4'] = 'mike.geek@example.com';
  17. $input_values['input_1_5'] = '12345678';
  18. $input_values['input_1_5_2'] = '12345678';
  19. $input_values['gform_save'] = true; // support for save and continue
  20.  
  21. $result = GFAPI::submit_form(1, $input_values );
  22.  
  23. return $result;
  24. }
  25.  
  26. {
  27. "is_valid": true,
  28. "page_number": 1,
  29. "source_page_number": 1,
  30. "confirmation_message": "",
  31. "confirmation_type": "message",
  32. "entry_id": "",
  33. "resume_token": "6b8a141b12b8465aad1e428ccb9147b1"
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement