本文整理汇总了PHP中optionsframework_option_name函数的典型用法代码示例。如果您正苦于以下问题:PHP optionsframework_option_name函数的具体用法?PHP optionsframework_option_name怎么用?PHP optionsframework_option_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了optionsframework_option_name函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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
示例2: 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
示例3: set_theme_option
/**
* Sets option defaults
*
* @since 1.7.0
*/
function set_theme_option()
{
// 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);
}
}
}
开发者ID:onenonlycasper,项目名称:infinitum,代码行数:31,代码来源:class-options-framework.php
示例4: of_get_option
/**
* Get Option.
*
* Helper function to return the theme option value.
* If no value has been saved, it returns $default.
* Needed because options are saved as serialized strings.
*/
function of_get_option($name, $default = false)
{
$config = get_option(optionsframework_option_name());
if (!isset($config['id'])) {
return $default;
}
$options = get_option($config['id']);
if (isset($options[$name])) {
return $options[$name];
}
return $default;
}
开发者ID:jcglp,项目名称:wptheme-modelo,代码行数:19,代码来源:theme-options.php
示例5: get_option_name
/**
* Gets option name
*
* @since 1.9.0
*/
function get_option_name()
{
$name = '';
// Gets option name as defined in the theme
if (function_exists('optionsframework_option_name')) {
$name = optionsframework_option_name();
}
// Fallback
if ('' == $name) {
$name = get_option('stylesheet');
$name = preg_replace("/\\W/", "_", strtolower($name));
}
return apply_filters('options_framework_option_name', $name);
}
开发者ID:Tamiiy,项目名称:spartan-english,代码行数:19,代码来源:class-options-framework.php
示例6: onetone_of_get_options
function onetone_of_get_options($default = false)
{
//$optionsframework_settings = get_option(ONETONE_OPTIONS_PREFIXED.'optionsframework');
// Gets the unique option id
//$option_name = $optionsframework_settings['id'];
$option_name = optionsframework_option_name();
if (get_option($option_name)) {
$options = get_option($option_name);
}
if (isset($options)) {
return $options;
} else {
return $default;
}
}
开发者ID:nvvetal,项目名称:water,代码行数:15,代码来源:theme-setup.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';
// Require Markdown if not loaded
if (!function_exists('Markdown')) {
require_once dirname(__FILE__) . '/markdown.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:recca004,项目名称:JAS,代码行数:43,代码来源:options-framework.php
示例8: of_get_option
function of_get_option($name, $default = false)
{
$option_name = '';
// Gets option name as defined in the theme
if (function_exists('optionsframework_option_name')) {
$option_name = optionsframework_option_name();
}
// Fallback option name
if ('' == $option_name) {
$option_name = get_option('stylesheet');
$option_name = preg_replace("/\\W/", "_", strtolower($option_name));
}
// Get option settings from database
$options = get_option($option_name);
if (isset($options[$name])) {
return $options[$name];
}
return $default;
}
开发者ID:vedarajraviraj,项目名称:Arcis-Consulting,代码行数:19,代码来源:options-framework.php
示例9: onetone_of_get_options
function onetone_of_get_options($default = false)
{
//$optionsframework_settings = get_option(ONETONE_OPTIONS_PREFIXED.'optionsframework');
// Gets the unique option id
//$option_name = $optionsframework_settings['id'];
$option_name = optionsframework_option_name();
if (get_option($option_name)) {
$options = get_option($option_name);
} else {
$location = apply_filters('options_framework_location', array('includes/admin-options.php'));
if ($optionsfile = locate_template($location)) {
$maybe_options = (require_once $optionsfile);
if (is_array($maybe_options)) {
$options = $maybe_options;
} else {
if (function_exists('optionsframework_options')) {
$options = optionsframework_options();
}
}
}
$options = apply_filters('of_options', $options);
$config = $options;
foreach ((array) $config as $option) {
if (!isset($option['id'])) {
continue;
}
if (!isset($option['std'])) {
continue;
}
if (!isset($option['type'])) {
continue;
}
$output[$option['id']] = apply_filters('of_sanitize_' . $option['type'], $option['std'], $option);
}
$options = $output;
}
if (isset($options)) {
return $options;
} else {
return $default;
}
}
开发者ID:russtx,项目名称:tac,代码行数:42,代码来源:theme-setup.php
示例10: 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);
}
}
$optionsframework_settings = get_option('optionsframework');
$saved_settings = get_option($optionsframework_settings['id']);
// If the option has no saved data, load the defaults
if (!$saved_settings) {
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:scottnkerr,项目名称:eeco,代码行数:42,代码来源:options-framework.php
示例11: 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
示例12: 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
示例13: cordillera_of_get_options
function cordillera_of_get_options($default = false)
{
// Gets the unique option id
$option_name = optionsframework_option_name();
if (get_option($option_name)) {
$options = get_option($option_name);
}
if (isset($options)) {
return $options;
} else {
return $default;
}
}
开发者ID:responso,项目名称:wordpress-heroku,代码行数:13,代码来源:theme-setup.php
示例14: onetone_of_get_options
function onetone_of_get_options($default = false)
{
global $options_saved, $onetone_default_options;
$options_saved = false;
//$optionsframework_settings = get_option(ONETONE_OPTIONS_PREFIXED.'optionsframework');
$default_options = optionsframework_options();
foreach ((array) $default_options as $option) {
if (!isset($option['id'])) {
continue;
}
if (!isset($option['std'])) {
continue;
}
if (!isset($option['type'])) {
continue;
}
$onetone_default_options[$option['id']] = apply_filters('of_sanitize_' . $option['type'], $option['std'], $option);
}
// Gets the unique option id
//$option_name = $optionsframework_settings['id'];
$option_name = optionsframework_option_name();
if (get_option($option_name)) {
$options = get_option($option_name);
$options_saved = true;
} else {
$options = $onetone_default_options;
}
if (isset($options)) {
return $options;
} else {
return $default;
}
}
开发者ID:JasonAJames,项目名称:jasonajamescom,代码行数:33,代码来源:theme-setup.php
示例15: torch_of_get_options
function torch_of_get_options($default = FALSE)
{
// Gets the unique option id
$option_name = optionsframework_option_name();
if (get_option($option_name)) {
$options = get_option($option_name);
}
if (isset($options)) {
return $options;
} else {
return $default;
}
}
开发者ID:mrbadao,项目名称:automatic,代码行数:13,代码来源:theme-setup.php
示例16: optionsframework_init
function optionsframework_init()
{
// Include the required files
require_once dirname(__FILE__) . '/options-interface.php';
require_once dirname(__FILE__) . '/options-medialibrary-uploader.php';
require_once OPTIONS_FRAMEWORK_ROOT . 'options-data.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';
}
//Check if theme has data
$theme_data_status = get_option($option_name . '_init');
if ($theme_data_status != "") {
//OK
} else {
options_setdefaults();
update_option($option_name . '_init', '1');
}
// 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($_POST['mtheme_options_nonce'])) {
if (empty($_POST) || !wp_verify_nonce($_POST['mtheme_options_nonce'], basename(__FILE__))) {
// Don't pass me by
print 'Sorry, your nonce did not verify.';
} else {
if (isset($_POST['update'])) {
$clean = array();
$options = optionsframework_options();
$exportpack = "array(";
$update_values = true;
//print_r($options);
// IMPORT user entered export data pack.
$importpack = array();
$importpack = $_POST[$option_name]['importpack'];
if ($importpack != "" && is_serialized($importpack)) {
add_settings_error('options-framework', 'restore_defaults', __('Options Imported!', 'mthemelocal'), 'updated fade');
$update_values = false;
$import_value = "";
$importpack = stripslashes_deep($importpack);
$imported_values = array();
$imported_values = unserialize($importpack);
//var_export($imported_values);
foreach ($imported_values as $key => $value) {
//echo $key;
//echo $value;
foreach ($value as $store_key => $store_value) {
//echo $store_key;
//echo $store_value;
update_option('mtheme_' . $store_key, $store_value);
if (is_array($store_value) && $store_key == "header_section_order") {
//update('mtheme_' . $home_key, $store_value );
foreach ($store_value as $home_key => $home_value) {
//echo $home_key;
//echo $home_value;
}
}
}
}
update_option('mtheme_exportpack', $importpack);
} elseif ($importpack != "" && !is_serialized($importpack)) {
add_settings_error('options-framework', 'restore_defaults', __('Invalid Import', 'mthemelocal'), 'error fade');
} else {
add_settings_error('options-framework', 'restore_defaults', __('Options Saved!', 'mthemelocal'), 'updated fade');
}
if ($update_values) {
$countarray = 0;
$export_options = array();
foreach ($options as $value) {
if (isset($value['id']) && !empty($value['id'])) {
if (isset($_POST[$option_name][$value['id']])) {
$hold_save_value = $_POST[$option_name][$value['id']];
if ($value['type'] == "text") {
$hold_save_value = stripslashes_deep($hold_save_value);
}
if (!isset($option)) {
$option = "";
}
if ($value['type'] == "dragdrop_sorter") {
$sort_array = $hold_save_value;
$save_value = array();
foreach ($sort_array as $sortkey => $sortstate) {
$save_value[] = $sortkey;
}
} else {
$save_value = apply_filters('of_sanitize_' . $value['type'], $hold_save_value, $option);
}
}
if ($value['type'] == "checkbox") {
if (isset($_POST[$option_name][$value['id']])) {
//.........这里部分代码省略.........
开发者ID:rongandat,项目名称:scalaprj,代码行数:101,代码来源:options-framework.php
示例17: 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
注:本文中的optionsframework_option_name函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论