wp_user_settings [ WordPress Function ]
wp_user_settings ( No parameters )
| Defined at: |
|
Benzer Fonksiyonlar: set_user_setting, get_user_setting, wp_set_all_user_settings, get_all_user_settings, delete_user_setting
Saves and restores user interface settings stored in a cookie.
Checks if the current user-settings cookie is updated and stores it. When no cookie exists (different browser used), adds the last saved cookie restoring the settings.
Source
<?php
function wp_user_settings() {
if ( ! is_admin() )
return;
if ( defined('DOING_AJAX') )
return;
if ( ! $user = wp_get_current_user() )
return;
$settings = get_user_option( 'user-settings', $user->ID );
if ( isset( $_COOKIE['wp-settings-' . $user->ID] ) ) {
$cookie = preg_replace( '/[^A-Za-z0-9=&_]/', '', $_COOKIE['wp-settings-' . $user->ID] );
if ( ! empty( $cookie ) && strpos( $cookie, '=' ) ) {
if ( $cookie == $settings )
return;
$last_time = (int) get_user_option( 'user-settings-time', $user->ID );
$saved = isset( $_COOKIE['wp-settings-time-' . $user->ID]) ? preg_replace( '/[^0-9]/', '', $_COOKIE['wp-settings-time-' . $user->ID] ) : 0;
if ( $saved > $last_time ) {
update_user_option( $user->ID, 'user-settings', $cookie, false );
update_user_option( $user->ID, 'user-settings-time', time() - 5, false );
return;
}
}
}
setcookie( 'wp-settings-' . $user->ID, $settings, time() + 31536000, SITECOOKIEPATH );
setcookie( 'wp-settings-time-' . $user->ID, time(), time() + 31536000, SITECOOKIEPATH );
$_COOKIE['wp-settings-' . $user->ID] = $settings;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Fatal error: Call to undefined function wp_user_settings() - WordPress
I keep getting "Fatal error: Call to undefined function wp_user_settings() in /home /content/h/o/u/housedogjp/html/wp-admin/admin-header.php on line 14 ...
wordpress.org - wp_user_settings (WordPress Function) - WPSeek.com
WordPress lookup for wp_user_settings, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - PHPXRef 0.7 : WordPress : Function Reference: wp_user_settings()
Function and Method Cross Reference. wp_user_settings(). Defined at: /wp- includes/option.php -> line 521. Referenced 2 times: ...
phpxref.ftwr.co.uk - Silverlight Zone: Storing WP User Settings - by Nick Randolph
May 10, 2012 ... Storing WP User Settings - by Nick Randolph. Tweet. In this article we're going to look at how you can persist settings for your Windows Phone ...
www.silverlight-zone.com