Make WordPress Core


Ignore:
Timestamp:
08/18/2022 11:43:34 AM (21 months ago)
Author:
audrasjb
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/theme-install.php

    r53191 r53906  
    9797     *  - `install_themes_pre_updated`
    9898     *  - `install_themes_pre_upload`
     99     *  - `install_themes_pre_blockthemes`
    99100     *
    100101     * @since 2.8.0
     102     * @since 6.1.0 Added `install_themes_pre_blockthemes`.
    101103     */
    102104    do_action( "install_themes_pre_{$tab}" );
     
    186188            <li><a href="#" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a></li>
    187189            <li><a href="#" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></a></li>
     190            <li><a href="#" data-sort="blockthemes"><?php _ex( 'Block Themes', 'themes' ); ?></a></li>
    188191            <li><a href="#" data-sort="favorites"><?php _ex( 'Favorites', 'themes' ); ?></a></li>
    189192        </ul>
     
    270273     *  - `install_themes_updated`
    271274     *  - `install_themes_upload`
     275     *  - `install_themes_blockthemes`
    272276     *
    273277     * @since 2.8.0
     278     * @since 6.1.0 Added `install_themes_blockthemes`.
    274279     *
    275280     * @param int $paged Number of the current page of results being viewed.
Note: See TracChangeset for help on using the changeset viewer.