REST API: Make JS Client store schema in session storage.
Props adamsilverstein. Fixes #38895. git-svn-id: https://develop.svn.wordpress.org/trunk@39344 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e606bc36c1
commit
ed13670fde
@ -1017,7 +1017,7 @@
|
||||
success: function( newSchemaModel ) {
|
||||
|
||||
// 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 {
|
||||
sessionStorage.setItem( 'wp-api-schema-model' + model.get( 'apiRoot' ) + model.get( 'versionString' ), JSON.stringify( newSchemaModel ) );
|
||||
} catch ( error ) {
|
||||
|
Loading…
Reference in New Issue
Block a user