本文整理汇总了PHP中td_global::td_options方法的典型用法代码示例。如果您正苦于以下问题:PHP td_global::td_options方法的具体用法?PHP td_global::td_options怎么用?PHP td_global::td_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类td_global
的用法示例。
在下文中一共展示了td_global::td_options方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: td_theme_settings_read_for_demo
function td_theme_settings_read_for_demo()
{
$td_cookie_value = '';
if (isset($_COOKIE["td-cookie-demo-theme-options"])) {
$td_cookie_value = $_COOKIE["td-cookie-demo-theme-options"];
}
switch ($td_cookie_value) {
case 'style_1':
td_global::$td_options = unserialize(base64_decode(file_get_contents('files_cookies_settings/demo_style_1.txt', true)));
break;
case 'style_2':
td_global::$td_options = unserialize(base64_decode(file_get_contents('files_cookies_settings/demo_style_2.txt', true)));
break;
case 'style_3':
td_global::$td_options = unserialize(base64_decode(file_get_contents('files_cookies_settings/demo_style_3.txt', true)));
break;
case 'style_4':
td_global::$td_options = unserialize(base64_decode(file_get_contents('files_cookies_settings/demo_style_4.txt', true)));
break;
//read the database theme options if no cookie is found
//read the database theme options if no cookie is found
default:
td_global::$td_options = get_option(TD_THEME_OPTIONS_NAME);
}
}
示例2:
/**
* reading the theme settings
* if we are in demo mode looks for cookies
* else takes the settings from database
*/
static function read_once_theme_settings()
{
//this is for demo mode
if (TD_DEBUG_LIVE_THEME_STYLE) {
td_theme_settings_read_for_demo();
//this function is in demo folder td_theme_demo_cookies.php
//this is for deploy and dev
} else {
td_global::$td_options = get_option(TD_THEME_OPTIONS_NAME);
}
}
示例3: array
static function update_theme_settings($old_theme_settings)
{
$settings_buffer = array();
foreach (self::$td_options_to_be_imported as $option_id) {
if (isset($old_theme_settings[$option_id]) and !empty($old_theme_settings[$option_id])) {
$settings_buffer[$option_id] = $old_theme_settings[$option_id];
}
}
td_global::$td_options = $settings_buffer;
update_option(TD_THEME_OPTIONS_NAME, td_global::$td_options);
}
示例4: update
static function update()
{
//load all the theme's settings
td_global::$td_options = get_option(TD_THEME_OPTIONS_NAME);
/* ----------------------------------------------------------------------------
save the data
*/
//print_r($_POST);
foreach ($_POST as $post_data_source => $post_value) {
switch ($post_data_source) {
case 'td_category':
self::update_category($post_value);
break;
case 'td_option':
self::update_td_option($post_value);
break;
case 'wp_option':
self::update_wp_option($post_value);
break;
case 'td_homepage':
break;
case 'td_page_option':
break;
case 'td_author':
self::update_td_author($post_value);
break;
case 'wp_widget':
self::update_wp_widget($post_value);
break;
case 'wp_theme_mod':
self::update_wp_theme_mod($post_value);
break;
case 'wp_theme_menu_spot':
self::update_wp_theme_menu_spot($post_value);
break;
case 'td_translate':
self::update_td_translate($post_value);
break;
case 'td_ads':
self::update_td_ads($post_value);
break;
//social networks
//social networks
case 'td_social_networks':
self::update_td_social_networks($post_value);
break;
case 'td_fonts':
self::update_td_fonts($post_value);
break;
case 'td_block_styles':
self::update_td_block_styles($post_value);
break;
}
}
//compile user css if any
td_global::$td_options['tds_user_compile_css'] = td_css_generator();
//save all the themes settings (td_options + td_category)
update_option(TD_THEME_OPTIONS_NAME, td_global::$td_options);
}
示例5:
/**
* reading the theme settings
* if we are in demo mode looks for cookies
* else takes the settings from database
*/
static function read_once_theme_settings()
{
td_global::$td_options = get_option(TD_THEME_OPTIONS_NAME);
}
示例6:
<!-- homepage -->
<div id="td-panel-welcome" class="td-panel-active td-panel">
<!-- One click demo install -->
<?php
echo td_panel_generator::box_start('Importing old category data');
?>
<!-- Install demo data -->
<div class="td-box-row">
<div class="td-box-description td-box-full">
<span class="td-box-title">Please wait until all the data is imported</span>
<p>....</p>
<?php
td_global::$td_options = get_option(TD_THEME_OPTIONS_NAME);
$td_categories = get_categories(array('hide_empty' => '0'));
foreach ($td_categories as $td_category) {
echo '<p><strong>Importing: ' . $td_category->name . '</strong><br>';
$td_cat_options = get_option('tax_meta_' . $td_category->cat_ID);
if (!empty($td_cat_options['tdc_layout'])) {
echo 'layout: ' . $td_cat_options['tdc_layout'] . '<br>';
td_panel_data_source::update_category_option($td_category->cat_ID, 'tdc_layout', $td_cat_options['tdc_layout']);
}
if (!empty($td_cat_options['tdc_sidebar_pos'])) {
echo 'sidebar position: ' . $td_cat_options['tdc_sidebar_pos'] . '<br>';
td_panel_data_source::update_category_option($td_category->cat_ID, 'tdc_sidebar_pos', $td_cat_options['tdc_sidebar_pos']);
}
if (!empty($td_cat_options['tdc_sidebar_name'])) {
echo 'sidebar name: ' . $td_cat_options['tdc_sidebar_name'] . '<br>';
td_panel_data_source::update_category_option($td_category->cat_ID, 'tdc_sidebar_name', $td_cat_options['tdc_sidebar_name']);
示例7: update
static function update()
{
//load all the theme's settings
td_global::$td_options = get_option(TD_THEME_OPTIONS_NAME);
/* ----------------------------------------------------------------------------
save the data
*/
foreach ($_POST as $post_data_source => $post_value) {
switch ($post_data_source) {
case 'td_category':
self::update_category($post_value);
break;
case 'td_option':
self::update_td_option($post_value);
break;
case 'wp_option':
self::update_wp_option($post_value);
break;
case 'td_homepage':
break;
case 'td_page_option':
break;
case 'td_author':
self::update_td_author($post_value);
break;
case 'wp_widget':
self::update_wp_widget($post_value);
break;
case 'wp_theme_mod':
self::update_wp_theme_mod($post_value);
break;
case 'wp_theme_menu_spot':
self::update_wp_theme_menu_spot($post_value);
break;
case 'td_translate':
self::update_td_translate($post_value);
break;
case 'td_ads':
self::update_td_ads($post_value);
break;
case 'td_fonts':
self::update_td_fonts($post_value);
break;
}
}
//save all the themes settings (td_options + td_category)
update_option(TD_THEME_OPTIONS_NAME, td_global::$td_options);
}
示例8: import_panel_settings
public function import_panel_settings($file_path, $empty_ignored_settings = false)
{
//it's public only for testing
// this settings will be "" out when any of the imports is runned
$ignored_settings = array('tds_logo_upload', 'tds_logo_upload_r', 'tds_favicon_upload', 'tds_logo_menu_upload', 'tds_logo_menu_upload_r', 'tds_footer_logo_upload', 'tds_footer_retina_logo_upload', 'tds_site_background_image', 'category_options', 'td_ads', 'sidebars');
//read the settings file
$file_settings = unserialize(base64_decode(file_get_contents($file_path, true)));
//apply td_cake variables
$file_settings['td_cake_status_time'] = td_util::get_option('td_cake_status_time');
$file_settings['td_cake_status'] = td_util::get_option('td_cake_status');
$file_settings['envato_key'] = td_util::get_option('envato_key');
if ($empty_ignored_settings === true) {
// we empty the ignored settings
td_global::$td_options = $file_settings;
foreach ($ignored_settings as $setting) {
td_global::$td_options[$setting] = '';
}
} else {
// we leave the ignored settings alone
foreach ($file_settings as $setting_id => $setting_value) {
if (!in_array($setting_id, $ignored_settings)) {
td_global::$td_options[$setting_id] = $setting_value;
}
}
}
//compile user css if any
td_global::$td_options['tds_user_compile_css'] = td_css_generator();
//write the changes to the database
update_option(TD_THEME_OPTIONS_NAME, td_global::$td_options);
}