Skip to content

Commit

Permalink
Fix JS error when ap.apiRequest has no preload data (#6194)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored Apr 16, 2018
1 parent d5fc1cf commit 33dc86e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function getStablePath( path ) {
wp.apiRequest = function( request ) {
var method, path;
if ( typeof request.path === 'string' ) {
if ( typeof request.path === 'string' && window._wpAPIDataPreload ) {
method = request.method || 'GET';
path = getStablePath( request.path );
Expand Down

0 comments on commit 33dc86e

Please sign in to comment.