コード例 #1
0
 public static function check_is_spam($lead_data)
 {
     $api_key = Inbound_Akismet::get_api_key();
     /* return true if akismet is not setup */
     if (!$api_key) {
         return false;
     }
     $params = Inbound_Akismet::prepare_params($lead_data);
     $is_spam = Inbound_Akismet::api_check($params);
     /* if not spam return false */
     if (!$is_spam) {
         return false;
     }
     /* Discover which filter is calling the spam check and react to spam accordingly */
     switch (current_filter()) {
         /* Kill ajax script if inbound_store_lead_pre hook */
         case 'inbound_store_lead_pre':
             exit;
             break;
             /* Return true to prevent email actions if form_actions_spam_check hook */
         /* Return true to prevent email actions if form_actions_spam_check hook */
         case 'form_actions_spam_check':
             return true;
             break;
     }
 }
コード例 #2
0
 public static function check_is_spam($is_spam = false, $lead_data)
 {
     $api_key = Inbound_Akismet::get_api_key();
     /* return false if akismet is not setup */
     if (!$api_key) {
         return false;
     }
     $params = Inbound_Akismet::prepare_params($lead_data);
     $is_spam = Inbound_Akismet::api_check($params);
     /* if not spam return false */
     if (!$is_spam) {
         return false;
     } else {
         return true;
     }
 }