当前位置: 首页>>代码示例>>PHP>>正文


PHP Ai1ec_I18n::_方法代码示例

本文整理汇总了PHP中Ai1ec_I18n::_方法的典型用法代码示例。如果您正苦于以下问题:PHP Ai1ec_I18n::_方法的具体用法?PHP Ai1ec_I18n::_怎么用?PHP Ai1ec_I18n::_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ai1ec_I18n的用法示例。


在下文中一共展示了Ai1ec_I18n::_方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: validate_challenge

 /**
  * Validates challenge.
  *
  * @param array Challenge response data.
  *
  * @return mixed
  */
 public function validate_challenge(array $data)
 {
     $response = array('success' => true);
     if (empty($data['recaptcha_challenge_field']) || empty($data['recaptcha_response_field'])) {
         $response['message'] = Ai1ec_I18n::_('There was an error reading the human verification data. Please try again.');
         $response['success'] = false;
     }
     require_once AI1EC_VENDOR_PATH . 'recaptcha/recaptchalib.php';
     $resp = recaptcha_check_answer($this->_settings->get('google_recaptcha_private_key'), $_SERVER['REMOTE_ADDR'], $data['recaptcha_challenge_field'], $data['recaptcha_response_field']);
     if (!$resp->is_valid) {
         $response['message'] = Ai1ec_I18n::__('Please try verifying you are human again.');
         $response['success'] = false;
     }
     return $response;
 }
开发者ID:sedici,项目名称:wpmu-istec,代码行数:22,代码来源:recaptcha.php

示例2: validate_challenge

 /**
  * Validates challenge.
  *
  * @param array Challenge response data.
  *
  * @return mixed
  */
 public function validate_challenge(array $data)
 {
     $response['message'] = Ai1ec_I18n::__('Please try verifying you are human again.');
     $response['success'] = false;
     if (empty($data['g-recaptcha-response'])) {
         $response['message'] = Ai1ec_I18n::_('There was an error reading the human verification data. Please try again.');
         $response['success'] = false;
     }
     $url = add_query_arg(array('secret' => $this->_settings->get('google_nocaptcha_private_key'), 'response' => $data['g-recaptcha-response']), 'https://www.google.com/recaptcha/api/siteverify');
     $json_resp = wp_remote_get($url);
     if (is_wp_error($json_resp)) {
         return $response;
     }
     $resp = json_decode($json_resp['body'], true);
     if (isset($resp['success']) && $resp['success']) {
         $response = array('success' => true);
     }
     return $response;
 }
开发者ID:zhebiewang,项目名称:WP,代码行数:26,代码来源:nocaptcha.php


注:本文中的Ai1ec_I18n::_方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。