本文整理汇总了PHP中wptouch_get_settings函数的典型用法代码示例。如果您正苦于以下问题:PHP wptouch_get_settings函数的具体用法?PHP wptouch_get_settings怎么用?PHP wptouch_get_settings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wptouch_get_settings函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wptouch_admin_get_root_slug
function wptouch_admin_get_root_slug($network_admin = false)
{
$menu = wptouch_admin_get_predefined_menus();
$settings = wptouch_get_settings();
if (defined('WPTOUCH_IS_FREE')) {
$show_wizard = $settings->show_free_wizard;
} else {
$show_wizard = $settings->show_wizard;
}
$show_network_wizard = $settings->show_network_wizard;
$network_admin = is_network_admin();
if ($network_admin) {
if ($show_network_wizard) {
return $menu[WPTOUCH_PRO_ADMIN_WIZARD]->slug;
} else {
return $menu[WPTOUCH_PRO_ADMIN_GENERAL_SETTINGS]->slug;
}
} else {
if ($show_wizard) {
return $menu[WPTOUCH_PRO_ADMIN_WIZARD]->slug;
} else {
if (defined('WPTOUCH_SHOW_WIZARD')) {
return $menu[WPTOUCH_PRO_ADMIN_WIZARD]->slug;
}
return $menu[WPTOUCH_PRO_ADMIN_GENERAL_SETTINGS]->slug;
}
}
}
示例2: foundation_get_page_walker
function foundation_get_page_walker($walker, $menu_name)
{
global $wptouch_pro;
// Don't do anything for WordPress menus
if (is_array($wptouch_pro->theme_menus) && count($wptouch_pro->theme_menus)) {
foreach ($wptouch_pro->theme_menus as $menu_info) {
$settings = wptouch_get_settings($menu_info->settings_domain);
$setting_value = $menu_info->setting_name;
if (isset($settings->{$setting_value})) {
$menu_to_show = $settings->{$setting_value};
if ($menu_name == $menu_to_show) {
// This is the menu that is showing
switch ($menu_info->menu_type) {
case 'dropdown':
// This is already taken care of by the walkel
break;
default:
$walker = apply_filters('wptouch_unhandled_page_walker', $walker, $menu_info->menu_type);
break;
}
}
}
}
}
return $walker;
// $wptouch_pro->theme_menus[] = $menu;
}
示例3: wptouch_admin_get_predefined_menus
function wptouch_admin_get_predefined_menus($network_only = false)
{
$available_menus = array();
if ($network_only) {
$available_menus = array(WPTOUCH_PRO_ADMIN_TOUCHBOARD => wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_TOUCHBOARD, __('What\'s New', 'wptouch-pro')));
} else {
$available_menus = array(WPTOUCH_PRO_ADMIN_TOUCHBOARD => wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_TOUCHBOARD, __('What\'s New', 'wptouch-pro')), WPTOUCH_PRO_ADMIN_GENERAL_SETTINGS => wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_GENERAL_SETTINGS, __('Core Settings', 'wptouch-pro')), WPTOUCH_PRO_ADMIN_THEMES_AND_ADDONS => wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_THEMES_AND_ADDONS, __('Themes & Extensions', 'wptouch-pro')), WPTOUCH_PRO_ADMIN_THEME_OPTIONS => wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_THEME_OPTIONS, __('Theme Settings', 'wptouch-pro'), WPTOUCH_PRO_ADMIN_SETTINGS_PAGE, sprintf(__('%s Settings', 'wptouch-pro'), wptouch_get_bloginfo('active_theme_friendly_name'))));
$settings = wptouch_get_settings();
if (isset($settings->active_addons) && is_array($settings->active_addons) && count($settings->active_addons)) {
$available_menus[WPTOUCH_PRO_ADMIN_ADDON_OPTIONS] = wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_ADDON_OPTIONS, __('Extension Settings', 'wptouch-pro'));
}
if (wptouch_get_registered_theme_count()) {
// Need to see if a theme has a menu available
$available_menus[WPTOUCH_PRO_ADMIN_MENUS] = wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_MENUS, __('Menus', 'wptouch-pro'));
} else {
$available_menus[WPTOUCH_PRO_ADMIN_MENUS_DISABLED] = wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_MENUS_DISABLED, __('Menus', 'wptouch-pro'));
}
}
// Check multisite
if (!defined('WPTOUCH_IS_FREE') && (wptouch_can_show_license_menu() || defined('WPTOUCH_FORCE_SHOW_LICENSE_PANEL'))) {
$available_menus[WPTOUCH_PRO_ADMIN_LICENSE] = wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_LICENSE, __('License', 'wptouch-pro'), WPTOUCH_PRO_ADMIN_CUSTOM_PAGE);
}
// Check multisite
if (defined('WPTOUCH_IS_FREE')) {
$available_menus[WPTOUCH_PRO_ADMIN_UPGRADE] = wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_UPGRADE, __('Upgrade to Pro', 'wptouch-pro'), WPTOUCH_PRO_ADMIN_CUSTOM_PAGE);
} elseif (!defined('WPTOUCH_CLIENT_MODE') && wptouch_license_upgrade_available()) {
$available_menus[WPTOUCH_PRO_ADMIN_UPGRADE_LICENSE] = wptouch_admin_create_menu(WPTOUCH_PRO_ADMIN_UPGRADE_LICENSE, __('Upgrade License', 'wptouch-pro'), WPTOUCH_PRO_ADMIN_CUSTOM_PAGE);
}
return apply_filters('wptouch_available_menus', $available_menus);
}
示例4: foundation_google_fonts_init
function foundation_google_fonts_init()
{
$settings = wptouch_get_settings('foundation');
if ($settings->typography_sets != 'default') {
wp_enqueue_script('foundation_google_fonts', foundation_get_base_module_url() . '/google-fonts/google-fonts.js', false, md5(FOUNDATION_VERSION), true);
}
$selected_font_info = foundation_google_fonts_get_selected_info();
if ($selected_font_info) {
$family_string = '';
$inline_style_data = '';
if (is_array($selected_font_info) && count($selected_font_info)) {
$new_families = array();
foreach ($selected_font_info as $font_info) {
$font_string = htmlentities($font_info->name);
if (isset($font_info->variants) && is_array($font_info->variants)) {
$font_string .= ':' . implode(',', $font_info->variants);
}
$new_families[] = $font_string;
$inline_style_data .= "." . $font_info->selector . "-font" . " {\n";
$inline_style_data .= "\tfont-family: '" . $font_info->name . "', " . $font_info->fallback . ";\n";
$inline_style_data .= "}\n";
}
$family_string = implode('|', $new_families);
}
if ($family_string) {
wp_enqueue_style('foundation_google_fonts', 'http://fonts.googleapis.com/css?family=' . $family_string, false, FOUNDATION_VERSION, false);
if ($inline_style_data) {
wp_add_inline_style('foundation_google_fonts', $inline_style_data);
}
}
}
}
示例5: wptouch_geolocation_enqueue_scripts
function wptouch_geolocation_enqueue_scripts()
{
$settings = wptouch_get_settings('foundation');
if ($settings->geolocation_enabled) {
wp_enqueue_script('geolocation-js', WPTOUCH_URL . '/pro/modules/geolocation/geolocation.js', false, FOUNDATION_VERSION, true);
}
}
示例6: wptouch_show_menu
function wptouch_show_menu($menu_slug = false, $nav_menu_walker = false, $page_menu_walker = false)
{
$menu_html = false;
$wptouch_menu_items = array();
$settings = wptouch_get_settings();
$parent_link_class = 'parent-links';
if (defined('WPTOUCH_MENU_LINK_PARENT_ITEMS') && WPTOUCH_MENU_LINK_PARENT_ITEMS == false) {
$parent_link_class = 'no-parent-links';
}
if (!$settings->enable_parent_items) {
$parent_link_class = 'no-parent-links';
}
if ($nav_menu_walker == false) {
$nav_menu_walker = new WPtouchProMainNavMenuWalker($settings->enable_menu_icons);
}
if ($page_menu_walker == false) {
$page_menu_walker = new WPtouchProMainPageMenuWalker($settings->enable_menu_icons);
}
// Render the menu
echo apply_filters('wptouch_menu_start_html', '<ul class="menu-tree' . ' ' . $parent_link_class . '">');
$menu_slugs_to_show = apply_filters('wptouch_menu_slugs_to_show', array($menu_slug));
global $wptouch_pro;
// Loop through all menus
foreach ($menu_slugs_to_show as $key => $menu_slug) {
foreach ($wptouch_pro->theme_menus as $menu_info) {
if ($menu_info->setting_name == $menu_slug) {
$can_be_disabled = $menu_info->can_be_disabled;
}
}
_wptouch_show_menu($menu_slug, $nav_menu_walker, $page_menu_walker, $can_be_disabled);
}
echo apply_filters('wptouch_menu_end_html', '</ul>');
}
示例7: wptouch_backup_settings
function wptouch_backup_settings()
{
global $wptouch_pro;
$backup_domains = $wptouch_pro->get_active_setting_domains();
if (is_array($backup_domains) && count($backup_domains)) {
$settings_to_save = array();
foreach ($backup_domains as $domain) {
$settings_notused = wptouch_get_settings($domain);
$settings = $wptouch_pro->settings_objects[$domain];
if (isset($settings->domain)) {
unset($settings->domain);
}
$settings_to_save[$domain] = apply_filters('wptouch_backup_settings', $settings, $domain);
}
ksort($settings_to_save);
$backup_string = base64_encode(gzcompress(serialize($settings_to_save), 9));
$backup_base_name = 'wptouch-backup-' . date('Ymd-His') . '.txt';
$backup_file_name = WPTOUCH_BACKUP_DIRECTORY . '/' . $backup_base_name;
$backup_file = fopen($backup_file_name, 'w+t');
if ($backup_file) {
fwrite($backup_file, $backup_string);
fclose($backup_file);
}
}
wptouch_prune_backup_files();
return $backup_base_name;
}
示例8: wptouch_admin_is_list_option_selected
function wptouch_admin_is_list_option_selected()
{
global $_primed_setting;
$settings = wptouch_get_settings($_primed_setting->domain, false);
$setting_name = $_primed_setting->name;
return isset($settings->{$setting_name}) && wptouch_admin_get_list_option_key() == $settings->{$setting_name};
}
示例9: wptouch_admin_get_setting_value
function wptouch_admin_get_setting_value()
{
global $_primed_setting;
$settings = wptouch_get_settings($_primed_setting->domain, false);
$setting_name = $_primed_setting->name;
if (isset($settings->{$setting_name})) {
return $settings->{$setting_name};
}
}
示例10: wptouch_fdn_show_login
function wptouch_fdn_show_login()
{
$settings = wptouch_get_settings();
if ($settings->show_login_box) {
return true;
} else {
return false;
}
}
示例11: wptouch_theme_custom_templates
function wptouch_theme_custom_templates($templates)
{
$settings = wptouch_get_settings();
if ($settings->wptouch_theme_show_archives) {
$templates[__('Archives', 'wptouch-pro')] = array('wptouch-archives');
}
if ($settings->wptouch_theme_show_links) {
$templates[__('Links', 'wptouch-pro')] = array('wptouch-links');
}
return $templates;
}
示例12: wptouch_should_load_rtl
function wptouch_should_load_rtl()
{
global $wptouch_pro;
if (is_admin()) {
$settings = wptouch_get_settings();
if (!$settings->translate_admin) {
return false;
}
}
return is_rtl() || $wptouch_pro->locale == 'ar' || $wptouch_pro->locale == 'he_IL';
}
示例13: wptouch_get_desktop_switch_link
function wptouch_get_desktop_switch_link()
{
$settings = wptouch_get_settings();
if ($settings->show_switch_link) {
if ($settings->home_page_redirect_address == 'same') {
return apply_filters('wptouch_desktop_switch_link', get_bloginfo('url') . '?wptouch_switch=mobile&redirect=' . urlencode($_SERVER['REQUEST_URI']));
} else {
return apply_filters('wptouch_desktop_switch_link', get_bloginfo('url') . '?wptouch_switch=mobile&redirect=' . get_bloginfo('url'));
}
}
}
示例14: wptouch_admin_is_setting_checked
function wptouch_admin_is_setting_checked()
{
global $_primed_setting;
$settings = wptouch_get_settings($_primed_setting->domain);
if ($settings) {
$name = $_primed_setting->name;
if (isset($settings->{$name})) {
return $settings->{$name} == 1;
}
}
return false;
}
示例15: wptouch_admin_split_setting_newline
function wptouch_admin_split_setting_newline()
{
global $_primed_setting;
$settings = wptouch_get_settings($_primed_setting->domain, false);
$setting_name = $_primed_setting->name;
if ($settings->{$setting_name} != '') {
$setting_data = explode("\r\n", $settings->{$setting_name});
} else {
$setting_data = array();
}
return $setting_data;
}