mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-15 23:25:50 +01:00
REST API: Make JS Client store schema in session storage.
Props adamsilverstein. Fixes #38895. Built from https://develop.svn.wordpress.org/trunk@39344 git-svn-id: http://core.svn.wordpress.org/trunk@39284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
14654d9539
commit
e20ded7e75
@ -1017,7 +1017,7 @@
|
|||||||
success: function( newSchemaModel ) {
|
success: function( newSchemaModel ) {
|
||||||
|
|
||||||
// Store a copy of the schema model in the session cache if available.
|
// Store a copy of the schema model in the session cache if available.
|
||||||
if ( ! _.isUndefined( sessionStorage ) && wpApiSettings.cacheSchema ) {
|
if ( ! _.isUndefined( sessionStorage ) && ( _.isUndefined( wpApiSettings.cacheSchema ) || wpApiSettings.cacheSchema ) ) {
|
||||||
try {
|
try {
|
||||||
sessionStorage.setItem( 'wp-api-schema-model' + model.get( 'apiRoot' ) + model.get( 'versionString' ), JSON.stringify( newSchemaModel ) );
|
sessionStorage.setItem( 'wp-api-schema-model' + model.get( 'apiRoot' ) + model.get( 'versionString' ), JSON.stringify( newSchemaModel ) );
|
||||||
} catch ( error ) {
|
} catch ( error ) {
|
||||||
|
2
wp-includes/js/wp-api.min.js
vendored
2
wp-includes/js/wp-api.min.js
vendored
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.7-beta4-39343';
|
$wp_version = '4.7-beta4-39344';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user