Make WordPress Core

Changeset 55995


Ignore:
Timestamp:
06/23/2023 01:35:32 PM (13 months ago)
Author:
audrasjb
Message:

Themes: Allow non-block themes to add theme support for border settings.

This changeset allows themes without theme.json to opt-in to block border tools via add_theme_support( 'border' );.

Follow-up to [55067], [55273].

Props poena, audrasjb.
Fixes #58598.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme-json-resolver.php

    r55694 r55995  
    315315            // Classic themes without a theme.json don't support global duotone.
    316316            $theme_support_data['settings']['color']['defaultDuotone'] = false;
     317
     318            // Allow themes to enable all border settings via theme_support.
     319            if ( current_theme_supports( 'border' ) ) {
     320                $theme_support_data['settings']['border']['color']  = true;
     321                $theme_support_data['settings']['border']['radius'] = true;
     322                $theme_support_data['settings']['border']['style']  = true;
     323                $theme_support_data['settings']['border']['width']  = true;
     324            }
    317325        }
    318326        $with_theme_supports = new WP_Theme_JSON( $theme_support_data );
Note: See TracChangeset for help on using the changeset viewer.