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. Built from https://develop.svn.wordpress.org/trunk@53906 git-svn-id: http://core.svn.wordpress.org/trunk@53465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
37cc6aacc1
commit
1b50325a5b
|
@ -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.
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -96,8 +96,10 @@ if ( $tab ) {
|
|||
* - `install_themes_pre_search`
|
||||
* - `install_themes_pre_updated`
|
||||
* - `install_themes_pre_upload`
|
||||
* - `install_themes_pre_blockthemes`
|
||||
*
|
||||
* @since 2.8.0
|
||||
* @since 6.1.0 Added `install_themes_pre_blockthemes`.
|
||||
*/
|
||||
do_action( "install_themes_pre_{$tab}" );
|
||||
}
|
||||
|
@ -185,6 +187,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
|
|||
<ul class="filter-links">
|
||||
<li><a href="#" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a></li>
|
||||
<li><a href="#" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></a></li>
|
||||
<li><a href="#" data-sort="blockthemes"><?php _ex( 'Block Themes', 'themes' ); ?></a></li>
|
||||
<li><a href="#" data-sort="favorites"><?php _ex( 'Favorites', 'themes' ); ?></a></li>
|
||||
</ul>
|
||||
|
||||
|
@ -269,8 +272,10 @@ if ( $tab ) {
|
|||
* - `install_themes_search`
|
||||
* - `install_themes_updated`
|
||||
* - `install_themes_upload`
|
||||
* - `install_themes_blockthemes`
|
||||
*
|
||||
* @since 2.8.0
|
||||
* @since 6.1.0 Added `install_themes_blockthemes`.
|
||||
*
|
||||
* @param int $paged Number of the current page of results being viewed.
|
||||
*/
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.1-alpha-53905';
|
||||
$wp_version = '6.1-alpha-53906';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue