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


PHP WPCF_Loader::init方法代码示例

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


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

示例1: wpcf_embedded_init

/**
 * Main init hook.
 *
 * All rest of init processes are continued here.
 * Sets locale, constants, includes...
 *
 * @todo Make sure plugin AND embedded code are calling this function on 'init'
 * @todo Test priorities
 */
function wpcf_embedded_init()
{
    global $types_instances, $wp_current_filter;
    // Record hook
    $types_instances['hook'] = $wp_current_filter;
    $types_instances['init_queued'] = '#' . did_action('init');
    $types_instances['init_priority'] = TYPES_INIT_PRIORITY;
    $types_instances['forced_embedded'] = defined('TYPES_LOAD_EMBEDDED') && TYPES_LOAD_EMBEDDED;
    // Loader
    require_once WPCF_EMBEDDED_ABSPATH . '/classes/loader.php';
    do_action('wpcf_before_init');
    do_action('types_before_init');
    // Define necessary constants if plugin is not present
    // This ones are skipped if used as embedded code!
    if (!defined('WPCF_VERSION')) {
        define('WPCF_VERSION', '1.6.6.3');
        define('WPCF_META_PREFIX', 'wpcf-');
    }
    // If forced embedded mode use path to __FILE__
    if (defined('TYPES_LOAD_EMBEDDED') && TYPES_LOAD_EMBEDDED || !defined('WPCF_RELPATH')) {
        define('WPCF_EMBEDDED_RELPATH', wpcf_get_file_url(__FILE__, false));
    } else {
        define('WPCF_EMBEDDED_RELPATH', WPCF_RELPATH . '/embedded');
    }
    // Define embedded paths
    define('WPCF_EMBEDDED_INC_RELPATH', WPCF_EMBEDDED_RELPATH . '/includes');
    define('WPCF_EMBEDDED_RES_RELPATH', WPCF_EMBEDDED_RELPATH . '/resources');
    // TODO INCLUDES!
    //
    // Please add all required includes here
    // Since Types 1.2 we can consider existing code as core.
    // All new functionalities should be added as includes HERE
    // and marked with @since Types $version.
    //
    // Thanks!
    //
    // Basic
    /*
     *
     * Mind class extensions queue
     */
    require_once WPCF_EMBEDDED_ABSPATH . '/classes/fields.php';
    require_once WPCF_EMBEDDED_ABSPATH . '/classes/field.php';
    require_once WPCF_EMBEDDED_ABSPATH . '/classes/usermeta_field.php';
    // Added by Gen, usermeta fields class
    // Repeater
    require_once WPCF_EMBEDDED_ABSPATH . '/classes/repeater.php';
    require_once WPCF_EMBEDDED_ABSPATH . '/classes/usermeta_repeater.php';
    // Added by Gen, usermeta repeater class
    require_once WPCF_EMBEDDED_INC_ABSPATH . '/repetitive-fields-ordering.php';
    require_once WPCF_EMBEDDED_INC_ABSPATH . '/repetitive-usermetafields-ordering.php';
    // Relationship
    require_once WPCF_EMBEDDED_ABSPATH . '/classes/relationship.php';
    // Conditional
    require_once WPCF_EMBEDDED_ABSPATH . '/classes/conditional.php';
    // API
    require_once WPCF_EMBEDDED_INC_ABSPATH . '/api.php';
    // Validation
    require_once WPCF_EMBEDDED_ABSPATH . '/classes/validation.php';
    // Post Types
    require_once WPCF_EMBEDDED_ABSPATH . '/classes/class.wpcf-post-types.php';
    // Import Export
    require_once WPCF_EMBEDDED_ABSPATH . '/classes/class.wpcf-import-export.php';
    // Module manager
    require_once WPCF_EMBEDDED_INC_ABSPATH . '/module-manager.php';
    // WPML specific code
    require_once WPCF_EMBEDDED_INC_ABSPATH . '/wpml.php';
    // CRED specific code.
    if (defined('CRED_FE_VERSION')) {
        require_once WPCF_EMBEDDED_INC_ABSPATH . '/cred.php';
    }
    /*
     *
     *
     * TODO This is a must for now.
     * See if any fields need to be loaded.
     *
     * 1. Checkboxes - may be missing when submitted
     */
    require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields/checkbox.php';
    /*
     *
     *
     * Use this call to load basic scripts and styles if necesary
     * wpcf_enqueue_scripts();
     */
    require_once WPCF_EMBEDDED_ABSPATH . '/usermeta-init.php';
    // Include frontend or admin code
    if (is_admin()) {
        require_once WPCF_EMBEDDED_ABSPATH . '/admin.php';
        /*
//.........这里部分代码省略.........
开发者ID:reginaldojunior,项目名称:blog,代码行数:101,代码来源:bootstrap.php


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