コード例 #1
0
 /**
  *	@return WP_reCaptcha
  */
 public static function instance()
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
コード例 #2
0
 /**
  *	Load ninja/cf7 php files if necessary
  *	Hooks into 'plugins_loaded'
  */
 function plugins_loaded()
 {
     if ($this->has_api_key()) {
         // NinjaForms support
         // check if ninja forms is present
         if (class_exists('Ninja_Forms') || function_exists('ninja_forms_register_field')) {
             WP_reCaptcha_NinjaForms::instance();
         }
         // CF7 support
         // check if contact form 7 forms is present
         if (function_exists('wpcf7')) {
             WP_reCaptcha_ContactForm7::instance();
         }
         // WooCommerce support
         // check if woocommerce is present
         if (function_exists('WC') || class_exists('WooCommerce')) {
             WP_reCaptcha_WooCommerce::instance();
         }
         if (class_exists('Awesome_Support')) {
             WP_reCaptcha_Awesome_Support::instance();
         }
         if (class_exists('bbPress')) {
             WP_reCaptcha_bbPress::instance();
         }
     }
 }