• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP optionsframework_setdefaults函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中optionsframework_setdefaults函数的典型用法代码示例。如果您正苦于以下问题:PHP optionsframework_setdefaults函数的具体用法?PHP optionsframework_setdefaults怎么用?PHP optionsframework_setdefaults使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: optionsframework_init

function optionsframework_init()
{
    // Include the required files
    require_once dirname(__FILE__) . '/options-interface.php';
    require_once dirname(__FILE__) . '/options-medialibrary-uploader.php';
    // Loads the options array from the theme
    if ($optionsfile = locate_template(array('options.php'))) {
        require_once $optionsfile;
    } else {
        if (file_exists(dirname(__FILE__) . '/options.php')) {
            require_once dirname(__FILE__) . '/options.php';
        }
    }
    $optionsframework_settings = get_option('optionsframework');
    // Updates the unique option id in the database if it has changed
    optionsframework_option_name();
    // Gets the unique id, returning a default if it isn't defined
    if (isset($optionsframework_settings['id'])) {
        $option_name = $optionsframework_settings['id'];
    } else {
        $option_name = 'optionsframework';
    }
    // If the option has no saved data, load the defaults
    if (!get_option($option_name)) {
        optionsframework_setdefaults();
    }
    // Registers the settings fields and callback
    register_setting('optionsframework', $option_name, 'optionsframework_validate');
    // Change the capability required to save the 'optionsframework' options group.
    add_filter('option_page_capability_optionsframework', 'optionsframework_page_capability');
}
开发者ID:foxydot,项目名称:madvia,代码行数:31,代码来源:options-framework.php


示例2: optionsframework_init

function optionsframework_init()
{
    // Include the required files
    require_once dirname(__FILE__) . '/featured-listing.php';
    require_once dirname(__FILE__) . '/options-interface.php';
    require_once dirname(__FILE__) . '/options-medialibrary-uploader.php';
    if ($optionsfile = locate_template(array('options.php'))) {
        require_once $optionsfile;
    } else {
        if (file_exists(dirname(__FILE__) . '/options.php')) {
            require_once dirname(__FILE__) . '/options.php';
        }
    }
    do_action('optionsframework_after_options_load');
    $optionsframework_settings = get_option('optionsframework');
    // Updates the unique option id in the database if it has changed
    optionsframework_option_name();
    // Gets the unique id, returning a default if it isn't defined
    if (isset($optionsframework_settings['id'])) {
        $option_name = $optionsframework_settings['id'];
    } else {
        $option_name = 'optionsframework';
    }
    // If the option has no saved data, load the defaults
    if (!get_option($option_name)) {
        optionsframework_setdefaults();
    }
    // Registers the settings fields and callback
    register_setting('optionsframework', $option_name, 'optionsframework_validate');
}
开发者ID:lytranuit,项目名称:wordpress,代码行数:30,代码来源:options-framework.php


示例3: optionsframework_init

function optionsframework_init()
{
    // Include the required files
    require_once dirname(__FILE__) . '/options-interface.php';
    require_once dirname(__FILE__) . '/options-media-uploader.php';
    // Loads the options array from the theme
    if ($optionsfile = locate_template(array('options.php'))) {
        require_once $optionsfile;
    } else {
        if (file_exists(dirname(__FILE__) . '/options.php')) {
            require_once dirname(__FILE__) . '/options.php';
        }
    }
    // Load settings
    $optionsframework_settings = get_option('optionsframework');
    // Update routine
    // This code can be removed if you're starting a new project
    // and don't have legacy users to support
    if ($optionsframework_settings && !isset($optionsframework_settings['version'])) {
        require_once dirname(__FILE__) . '/upgrade.php';
        optionsframework_upgrade_routine();
    }
    // Updates the unique option id in the database if it has changed
    optionsframework_option_name();
    // Gets the unique id, returning a default if it isn't defined
    if (isset($optionsframework_settings['id'])) {
        $option_name = $optionsframework_settings['id'];
    } else {
        $option_name = 'options_framework_theme';
    }
    // If the option has no saved data, load the defaults
    if (!get_option($option_name)) {
        optionsframework_setdefaults();
    }
    // Registers the settings fields and callback
    register_setting('optionsframework', $option_name, 'optionsframework_validate');
    // Change the capability required to save the 'optionsframework' options group.
    add_filter('option_page_capability_optionsframework', 'optionsframework_page_capability');
}
开发者ID:hunghoang179,项目名称:sitenews,代码行数:39,代码来源:options-framework.php


示例4: optionsframework_init

function optionsframework_init()
{
    // Include the required files
    require_once dirname(__FILE__) . '/options-sanitize.php';
    require_once dirname(__FILE__) . '/options-interface.php';
    require_once dirname(__FILE__) . '/options-medialibrary-uploader.php';
    // Loads the options array from the theme
    if ($optionsfile = locate_template(array('options.php'))) {
        $optionsfile = locate_template($location);
    } else {
        if (file_exists(dirname(__FILE__) . '/options.php')) {
            require_once dirname(__FILE__) . '/options.php';
        }
    }
    $optionsframework_settings = get_option('optionsframework');
    // Updates the unique option id in the database if it has changed
    optionsframework_option_name();
    // Gets the unique id, returning a default if it isn't defined
    $option_name = $optionsframework_settings['id'];
    // Set the option defaults in case they have changed
    optionsframework_setdefaults();
    // Registers the settings fields and callback
    register_setting('optionsframework', $option_name, 'optionsframework_validate');
}
开发者ID:jiyongcheng,项目名称:wp_rabbit,代码行数:24,代码来源:options-framework.php


示例5: hs_optionsframework_init

function hs_optionsframework_init()
{
    // Include the required files
    require_once dirname(__FILE__) . '/options-interface.php';
    require_once dirname(__FILE__) . '/options-medialibrary-uploader.php';
    // Loads the options array from the theme
    if ($optionsfile = locate_template(array('options.php'))) {
        require_once $optionsfile;
    } else {
        if (file_exists(dirname(__FILE__) . '/options.php')) {
            require_once dirname(__FILE__) . '/options.php';
        }
    }
    $optionsframework_settings = get_option('optionsframework');
    // Updates the unique option id in the database if it has changed
    optionsframework_option_name();
    // Gets the unique id, returning a default if it isn't defined
    if (isset($optionsframework_settings['id'])) {
        $option_name = $optionsframework_settings['id'];
    } else {
        $option_name = 'optionsframework';
    }
    // If the option has no saved data, load the defaults
    if (!get_option($option_name)) {
        optionsframework_setdefaults();
    }
    // Registers the settings fields and callback
    if (!isset($_POST['OptionsFramework-backup-import'])) {
        register_setting('optionsframework', $option_name, 'optionsframework_validate');
    }
    if (isset($_GET['buckupsuccess']) && $_GET['buckupsuccess'] == 'true') {
        add_settings_error('options-framework', 'save_options', __('All options are restored successfully.', HS_CURRENT_THEME), 'updated fade');
    }
    // Registers the settings fields and callback
    register_setting('optionsframework', $option_name, 'optionsframework_validate');
    // Change the capability required to save the 'optionsframework' options group.
    add_filter('option_page_capability_optionsframework', 'optionsframework_page_capability');
}
开发者ID:FelixNong1990,项目名称:andy,代码行数:38,代码来源:options-framework.php


示例6: optionsframework_rolescheck

}
/* If the user can't edit theme options, no use running this plugin */
add_action('init', 'optionsframework_rolescheck');
function optionsframework_rolescheck()
{
    if (current_user_can('edit_theme_options')) {
        // If the user can edit theme options, let the fun begin!
        add_action('admin_menu', 'optionsframework_add_page');
        add_action('admin_init', 'optionsframework_init');
        //add_action( 'admin_head', 'optionsframework_mlu_css' );
        //add_action( 'admin_head', 'optionsframework_mlu_js' );
    }
}
/* Loads the file for option sanitization */
add_action('init', 'optionsframework_load_sanitization');
function optionsframework_load_sanitization()
{
    require_once get_template_directory() . '/themeOptions/admin/options-sanitize.php';
}
/*
 * Creates the settings in the database by looping through the array
 * we supplied in options.php.  This is a neat way to do it since
 * we won't have to save settings for headers, descriptions, or arguments.
 *
 * Read more about the Settings API in the WordPress codex:
 * http://codex.wordpress.org/Settings_API
 *
 */
function optionsframework_init()
开发者ID:Snaehild,项目名称:GH2016,代码行数:29,代码来源:options-framework.php


示例7: optionsframework_init

function optionsframework_init()
{
    // Include the required files
    require_once dirname(__FILE__) . '/options-interface.php';
    require_once dirname(__FILE__) . '/options-media-uploader.php';
    // Optionally Loads the options file from the theme
    $location = apply_filters('options_framework_location', array('options.php'));
    $optionsfile = locate_template($location);
    // Load settings
    $optionsframework_settings = get_option('optionsframework');
    // Updates the unique option id in the database if it has changed
    if (function_exists('optionsframework_option_name')) {
        optionsframework_option_name();
    } elseif (has_action('optionsframework_option_name')) {
        do_action('optionsframework_option_name');
    } else {
        $default_themename = get_option('stylesheet');
        $default_themename = preg_replace("/\\W/", "_", strtolower($default_themename));
        $default_themename = 'optionsframework_' . $default_themename;
        if (isset($optionsframework_settings['id'])) {
            if ($optionsframework_settings['id'] == $default_themename) {
                // All good, using default theme id
            } else {
                $optionsframework_settings['id'] = $default_themename;
                update_option('optionsframework', $optionsframework_settings);
            }
        } else {
            $optionsframework_settings['id'] = $default_themename;
            update_option('optionsframework', $optionsframework_settings);
        }
    }
    // If the option has no saved data, load the defaults
    if (!get_option($optionsframework_settings['id'])) {
        optionsframework_setdefaults();
    }
    // Registers the settings fields and callback
    register_setting('optionsframework', $optionsframework_settings['id'], 'optionsframework_validate');
    // Change the capability required to save the 'optionsframework' options group.
    add_filter('option_page_capability_optionsframework', 'optionsframework_page_capability');
}
开发者ID:selectSIFISO,项目名称:.comsite,代码行数:40,代码来源:options-framework.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP optionsframework_tabs函数代码示例发布时间:2022-05-15
下一篇:
PHP optionsframework_options函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap