Created
September 24, 2017 13:55
-
-
Save keks55/6abda5a136f9ca9dbc265cb7097cf991 to your computer and use it in GitHub Desktop.
Session for Wordpress plugin
This file contains hidden or 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
| // session value | |
| function keksus_ae_session(){ | |
| global $option_name,$options; | |
| if( $options['captcha_on'] == '1' ){ | |
| session_start(); | |
| if(headers_sent()){ | |
| $digits = $options['captcha_digits']; | |
| $_SESSION['captcha'] = rand(pow(10, $digits-1), pow(10, $digits)-1); | |
| $captcha = $_SESSION['captcha']; | |
| return $captcha; | |
| } | |
| } | |
| elseif(isset($_SESSION)){ | |
| session_destroy(); | |
| } | |
| } | |
| add_action('init', 'keksus_ae_session'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment