Keypic::getSpamPercentage()) { remove_action('authenticate', 'wp_authenticate_username_password', 20); // TODO: make it better... return true; // SMAP } return false; // NOT SMAP } // Shortcode handler if(function_exists('wpcf7_add_shortcode')) wpcf7_add_shortcode( 'keypic', 'keypic_wpcf7_shortcode_handler', true ); function keypic_wpcf7_shortcode_handler( $tag ) { if ( ! is_array( $tag ) ) return ''; $options = (array) $tag['options']; $WeightHeight = ''; $RequestType = ''; foreach ( $options as $option ) { $t = explode(':', $option); if($t[0] == 'WeightHeight'){$WeightHeight = $t[1];} if($t[0] == 'RequestType'){$RequestType = $t[1];} } $Token = isset($_POST['Token']) ? $_POST['Token'] : ''; $html = ''; // if($RequestType == 'getiFrame'){$html .= Keypic::getiFrame($WeightHeight);} // else{$html .= Keypic::getImage($WeightHeight);} $html .= Keypic::getIt($RequestType, $WeightHeight); return $html; } // Tag generator add_action( 'admin_init', 'keypic_add_tag_generator', 45 ); function keypic_add_tag_generator() { if(function_exists('wpcf7_add_tag_generator')) wpcf7_add_tag_generator( 'keypic', __( 'Keypic', 'wpcf7' ), 'wpcf7-tg-pane-keypic', 'keypic_tg_pane_captcha' ); } function keypic_tg_pane_captcha( &$contact_form ) { ?>