Make WordPress Core


Ignore:
Timestamp:
06/25/2020 10:11:09 PM (4 years ago)
Author:
TimothyBlynJacobs
Message:

Themes: Introduce register_theme_feature API.

Currently themes can declare support for a given feature by using add_theme_support(). This commit adds a register_theme_feature() API that allows plugins and WordPress Core to declare a list of available features that themes can support.

The REST API uses this to expose a theme's supported features if the feature has been registered with "show_in_rest" set to true.

Props kadamwhite, spacedmonkey, williampatton, desrosj, TimothyBlynJacobs.
Fixes #49406.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-filters.php

    r48121 r48171  
    471471add_action( 'delete_attachment', '_delete_attachment_theme_mod' );
    472472add_action( 'transition_post_status', '_wp_keep_alive_customize_changeset_dependent_auto_drafts', 20, 3 );
     473add_action( 'setup_theme', 'create_initial_theme_features', 0 );
    473474
    474475// Calendar widget cache.
Note: See TracChangeset for help on using the changeset viewer.