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


PHP Ninja_Forms::setup_constants方法代码示例

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


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

示例1: instance

 /**
  * Main Ninja_Forms Instance
  *
  * Insures that only one instance of Ninja_Forms exists in memory at any one
  * time. Also prevents needing to define globals all over the place.
  *
  * @since 2.7
  * @static
  * @staticvar array $instance
  * @return The highlander Ninja_Forms
  */
 public static function instance()
 {
     if (!isset(self::$instance) && !self::$instance instanceof Ninja_Forms) {
         self::$instance = new Ninja_Forms();
         self::$instance->setup_constants();
         self::$instance->includes();
         // Start our submissions custom post type class
         self::$instance->subs_cpt = new NF_Subs_CPT();
         // Add our registration class object
         self::$instance->register = new NF_Register();
         // The forms variable won't be interacted with directly.
         // Instead, the forms() methods will act as wrappers for it.
         self::$instance->forms = new NF_Forms();
         // Our session manager wrapper class
         self::$instance->session = new NF_Session();
         register_activation_hook(__FILE__, 'ninja_forms_activation');
         add_action('plugins_loaded', array(self::$instance, 'load_lang'));
         add_action('init', array(self::$instance, 'init'), 5);
         add_action('admin_init', array(self::$instance, 'admin_init'), 5);
         add_action('update_option_ninja_forms_settings', array(self::$instance, 'refresh_plugin_settings'), 10);
         // add_action( 'admin_head', array( self::$instance, 'admin_head' ) );
         add_action('admin_notices', array(self::$instance, 'admin_notice'));
     }
     return self::$instance;
 }
开发者ID:jbs321,项目名称:portfolio,代码行数:36,代码来源:ninja-forms.php

示例2: instance

 /**
  * Main Ninja_Forms Instance
  *
  * Insures that only one instance of Ninja_Forms exists in memory at any one
  * time. Also prevents needing to define globals all over the place.
  *
  * @since 2.7
  * @static
  * @staticvar array $instance
  * @return The highlander Ninja_Forms
  */
 public static function instance()
 {
     if (!isset(self::$instance) && !self::$instance instanceof Ninja_Forms) {
         self::$instance = new Ninja_Forms();
         self::$instance->setup_constants();
         self::$instance->includes();
         // Start our submissions custom post type class
         self::$instance->subs_cpt = new NF_Subs_CPT();
         register_activation_hook(__FILE__, 'ninja_forms_activation');
         add_action('plugins_loaded', array(self::$instance, 'load_lang'));
         add_action('init', array(self::$instance, 'set_transient_id'), 1);
         add_action('init', array(self::$instance, 'init'), 5);
         add_action('admin_init', array(self::$instance, 'admin_init'), 5);
     }
     return self::$instance;
 }
开发者ID:USSLomaPrieta,项目名称:usslomaprieta.org,代码行数:27,代码来源:ninja-forms.php


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