Skip to content

Instantly share code, notes, and snippets.

@rahularyan
Created October 26, 2017 04:37
Show Gist options
  • Save rahularyan/ea30cb2c455c4e9a442fefcf2d969014 to your computer and use it in GitHub Desktop.
Save rahularyan/ea30cb2c455c4e9a442fefcf2d969014 to your computer and use it in GitHub Desktop.
<?php
/**
* Save custom form "sample_form".
*
* @return void
*/
function my_custom_ap_form() {
$form = anspress()->get_form( 'sample_form' );
// Get all sanitized values.
$values = $form->get_values();
// Check nonce and is valid form.
if ( ! $form->is_submitted() ) {
echo __( 'Holla, you trying to cheat!' )
return;
}
// you can start saving your data here.
}
add_action( 'init', 'my_custom_ap_form' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment