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:
Joe Hoyle 2016-11-23 02:55:30 +00:00
parent 14654d9539
commit e20ded7e75
3 changed files with 3 additions and 3 deletions

View File

@ -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 ) {

File diff suppressed because one or more lines are too long

View File

@ -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.