Skip to content

Commit

Permalink
Switch installTheme handler to a noop, to prevent AJAX install request
Browse files Browse the repository at this point in the history
  • Loading branch information
ryelle committed Feb 7, 2025
1 parent 2ccf4b2 commit 189c9a9
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* global Backbone, jQuery, wp */
( function ( $ ) {
var themes = wp.themes;
const themes = wp.themes;

/**
* Customize backbone router for theme subpage URL.
Expand All @@ -25,10 +26,15 @@
},

navigate: function ( url, state ) {
var router = this;
const router = this;
if ( Backbone.history._hasPushState ) {
Backbone.Router.prototype.navigate.call( router, url, state );
}
},
} );

// Switch installTheme handler to a noop, to prevent AJAX install request.
themes.view.Theme = themes.view.Theme.extend( {
installTheme: function () {},
} );
} )( jQuery );

0 comments on commit 189c9a9

Please sign in to comment.