mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 22:57:20 +00:00
Themes: Add a Block Themes filter in Theme Install Screen.
The Theme Directory on wordpress.org recently got updated to show a shortcut for filtering block themes. This changeset adds a "Block Themes" filter when adding a new theme from WordPress administration. It also introduces two new action hooks: `install_themes_pre_blockthemes` (fires before the tab is rendered) and `install_themes_blockthemes` (fires at the top the tab). Follow-up to [meta11963]. Props luminuu, audrasjb, SergeyBiryukov, rafiahmedd. Fixes #56283. See #meta6330. git-svn-id: https://develop.svn.wordpress.org/trunk@53906 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1694,7 +1694,18 @@ themes.view.Installer = themes.view.Appearance.extend({
|
||||
browse: function( section ) {
|
||||
// Create a new collection with the proper theme data
|
||||
// for each section.
|
||||
this.collection.query( { browse: section } );
|
||||
if ( 'blockthemes' === section ) {
|
||||
|
||||
var request = { tag: 'full-site-editing' };
|
||||
|
||||
// Get the themes by sending Ajax POST request to api.wordpress.org/themes
|
||||
// or searching the local cache.
|
||||
this.collection.query( request );
|
||||
return;
|
||||
|
||||
} else {
|
||||
this.collection.query( { browse: section } );
|
||||
}
|
||||
},
|
||||
|
||||
// Sorting navigation.
|
||||
|
||||
Reference in New Issue
Block a user