本文整理汇总了PHP中wp_user_settings函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_user_settings函数的具体用法?PHP wp_user_settings怎么用?PHP wp_user_settings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_user_settings函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printer_friendly_header
public static function printer_friendly_header($args = '')
{
define('IFRAME_REQUEST', true);
// In case admin-header.php is included in a function.
global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version, $current_site, $update_title, $total_update_count, $parent_file;
// Catch plugins that include admin-header.php before admin.php completes.
if (empty($current_screen)) {
set_current_screen();
}
get_admin_page_title();
$title = esc_html(strip_tags($title));
if (is_network_admin()) {
$admin_title = __('Network Admin', 'opentickets-community-edition');
} elseif (is_user_admin()) {
$admin_title = __('Global Dashboard', 'opentickets-community-edition');
} else {
$admin_title = get_bloginfo('name');
}
if ($admin_title == $title) {
$admin_title = sprintf(__('%1$s — WordPress', 'opentickets-community-edition'), $title);
} else {
$admin_title = sprintf(__('%1$s ‹ %2$s — WordPress', 'opentickets-community-edition'), $title, $admin_title);
}
$admin_title = apply_filters('admin_title', $admin_title, $title);
wp_user_settings();
_wp_admin_html_begin();
?>
<title><?php
echo $admin_title;
?>
</title>
<?php
wp_enqueue_style('colors');
wp_enqueue_style('ie');
wp_enqueue_script('utils');
$admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
?>
<script type="text/javascript">
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
var ajaxurl = '<?php
echo admin_url('admin-ajax.php', 'relative');
?>
',
pagenow = '<?php
echo $current_screen->id;
?>
',
typenow = '<?php
echo $current_screen->post_type;
?>
',
adminpage = '<?php
echo $admin_body_class;
?>
',
thousandsSeparator = '<?php
echo addslashes($wp_locale->number_format['thousands_sep']);
?>
',
decimalPoint = '<?php
echo addslashes($wp_locale->number_format['decimal_point']);
?>
',
isRtl = <?php
echo (int) is_rtl();
?>
;
</script>
<?php
do_action('admin_enqueue_scripts', $hook_suffix);
do_action("admin_print_styles-{$hook_suffix}");
do_action('admin_print_styles');
do_action("admin_print_scripts-{$hook_suffix}");
do_action('admin_print_scripts');
do_action("admin_head-{$hook_suffix}");
do_action('admin_head');
if (get_user_setting('mfold') == 'f') {
$admin_body_class .= ' folded';
}
if (!get_user_setting('unfold')) {
$admin_body_class .= ' auto-fold';
}
if (is_admin_bar_showing()) {
$admin_body_class .= ' admin-bar';
}
if (is_rtl()) {
$admin_body_class .= ' rtl';
}
$admin_body_class .= ' branch-' . str_replace(array('.', ','), '-', floatval($wp_version));
$admin_body_class .= ' version-' . str_replace('.', '-', preg_replace('/^([.0-9]+).*/', '$1', $wp_version));
$admin_body_class .= ' admin-color-' . sanitize_html_class(get_user_option('admin_color'), 'fresh');
$admin_body_class .= ' locale-' . sanitize_html_class(strtolower(str_replace('_', '-', get_locale())));
if (wp_is_mobile()) {
$admin_body_class .= ' mobile';
}
$admin_body_class .= ' no-customize-support';
?>
</head>
<body class="wp-admin wp-core-ui no-js <?php
echo apply_filters('admin_body_class', '') . " {$admin_body_class}";
//.........这里部分代码省略.........
示例2: sprintf
}
if ($admin_title == $title) {
$admin_title = sprintf(__('%1$s — WordPress'), $title);
} else {
$admin_title = sprintf(__('%1$s ‹ %2$s — WordPress'), $title, $admin_title);
}
/**
* Filter the <title> content for an admin page.
*
* @since 3.1.0
*
* @param string $admin_title The page title, with extra context added.
* @param string $title The original page title.
*/
$admin_title = apply_filters('admin_title', $admin_title, $title);
wp_user_settings();
_wp_admin_html_begin();
?>
<title><?php
echo $admin_title;
?>
</title>
<?php
wp_enqueue_style('colors');
wp_enqueue_style('ie');
wp_enqueue_script('utils');
wp_enqueue_script('svg-painter');
$admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
?>
<script type="text/javascript">
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
示例3: ym_admin_header
function ym_admin_header($page)
{
_wp_admin_html_begin();
do_action('admin_init');
// recall for scripts
ym_admin_script_init();
// In case admin-header.php is included in a function.
global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version, $is_iphone, $current_site, $update_title, $total_update_count, $parent_file;
// Catch plugins that include admin-header.php before admin.php completes.
if (empty($current_screen)) {
set_current_screen();
}
wp_user_settings();
wp_enqueue_style('colors');
wp_enqueue_style('ie');
do_action('admin_print_styles');
do_action('admin_print_scripts');
do_action('admin_head');
echo '<style type="text/css">
html.wp-toolbar {
padding-top: 0px;
}
#poststuff {
width: 100%;
margin: 0px;
}
</style>
';
echo '</head>';
?>
<body<?php
if (isset($GLOBALS['body_id'])) {
echo ' id="' . $GLOBALS['body_id'] . '"';
}
?>
class="no-js">
<script type="text/javascript">
document.body.className = document.body.className.replace('no-js', 'js');
</script>
<?php
}