Hi there
I'm saving input from a form out of a page, using "the_post" hook. The function is triggered by a variable in $_POST which is a filled checkbox in the form.
`function my_function(){
global $wpdb;
if ($_POST[checkbox_SOMECHECKBOX]){
do some things;
}
add_action('the_post', 'my_function');
While everything works, the function is called twice, rendering two times the action. I don't get it why. Would love to use that hook, as it allowes me to echo into the beginning of the page/post I'm loading as a response to the submitting of the form.
TIA for help