wordpress Shortocode running twice?

Try this way, it’s not the proper way to figure it out but it will solve your problem. function citrusafterpayment_function() { static $calls = 0; if($calls == 0){ $calls++; mail(‘[email protected]’,’check-in’,’asd’); global $wpdb; if(isset($_REQUEST[‘TxStatus’]) && $_REQUEST[‘TxStatus’] != ”) { if($_REQUEST[‘TxStatus’] == ‘CANCELED’) { $return_msg = ‘<div class=”row-fluid”><div class=”span12″> <div class=”error”>You have canceled your transaction.</div></div></div>’; return $return_msg; … Read more

WordPress ajax not working in registration

Move this action ‘ add_action( ‘wp_ajax_nopriv_add_to_register’, ‘to_register’ );’ from load_scripts function(). // Load scripts function load_scripts() { // I called jquery.min.js and jquery validation from function.php, not from here wp_enqueue_script(‘test-reg’, get_template_directory_uri() . ‘/js/my-test-reg.js’, array(‘jquery’), ‘1.0’, true ); wp_localize_script( ‘test-reg’, ‘myAjax’, array( ‘myUrl’ => admin_url(‘admin-ajax.php’) ) ); } add_action( ‘wp_ajax_nopriv_add_to_register’, ‘to_register’ ); Replace reg_form() function with … Read more