Update WP and plugins
This commit is contained in:
parent
10a4713229
commit
1fb77fc4ff
864 changed files with 101724 additions and 78262 deletions
|
|
@ -1,8 +1,13 @@
|
|||
/* global userSettings */
|
||||
/* exported getUserSetting, setUserSetting, deleteUserSetting */
|
||||
// utility functions
|
||||
/**
|
||||
* Cookie functions.
|
||||
*
|
||||
* @output wp-includes/js/utils.js
|
||||
*/
|
||||
|
||||
var wpCookies = {
|
||||
/* global userSettings, getAllUserSettings, wpCookies, setUserSetting */
|
||||
/* exported getUserSetting, setUserSetting, deleteUserSetting */
|
||||
|
||||
window.wpCookies = {
|
||||
// The following functions are from Cookie.js class in TinyMCE 3, Moxiecode, used under LGPL.
|
||||
|
||||
each: function( obj, cb, scope ) {
|
||||
|
|
@ -134,7 +139,7 @@ var wpCookies = {
|
|||
};
|
||||
|
||||
// Returns the value as string. Second arg or empty string is returned when value is not set.
|
||||
function getUserSetting( name, def ) {
|
||||
window.getUserSetting = function( name, def ) {
|
||||
var settings = getAllUserSettings();
|
||||
|
||||
if ( settings.hasOwnProperty( name ) ) {
|
||||
|
|
@ -146,12 +151,12 @@ function getUserSetting( name, def ) {
|
|||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
};
|
||||
|
||||
// Both name and value must be only ASCII letters, numbers or underscore
|
||||
// and the shorter, the better (cookies can store maximum 4KB). Not suitable to store text.
|
||||
// The value is converted and stored as string.
|
||||
function setUserSetting( name, value, _del ) {
|
||||
window.setUserSetting = function( name, value, _del ) {
|
||||
if ( 'object' !== typeof userSettings ) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -181,18 +186,17 @@ function setUserSetting( name, value, _del ) {
|
|||
wpCookies.set( 'wp-settings-time-' + uid, userSettings.time, 31536000, path, '', secure );
|
||||
|
||||
return name;
|
||||
}
|
||||
};
|
||||
|
||||
function deleteUserSetting( name ) {
|
||||
window.deleteUserSetting = function( name ) {
|
||||
return setUserSetting( name, '', 1 );
|
||||
}
|
||||
};
|
||||
|
||||
// Returns all settings as js object.
|
||||
function getAllUserSettings() {
|
||||
window.getAllUserSettings = function() {
|
||||
if ( 'object' !== typeof userSettings ) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return wpCookies.getHash( 'wp-settings-' + userSettings.uid ) || {};
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue