Created
October 26, 2017 04:37
-
-
Save rahularyan/ea30cb2c455c4e9a442fefcf2d969014 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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