WP_Duotone::register_duotone_support
Registers the style and colors block attributes for block types that support it.
Block support is added with supports.filter.duotone in block.json.
Метод класса: WP_Duotone{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$result = WP_Duotone::register_duotone_support( $block_type );
- $block_type(WP_Block_Type) (обязательный)
- Block Type.
Список изменений
| С версии 6.3.0 | Введена. |
Код WP_Duotone::register_duotone_support() WP Duotone::register duotone support WP 7.1.2
public static function register_duotone_support( $block_type ) {
/*
* Previous `color.__experimentalDuotone` support flag is migrated
* to `filter.duotone` via `block_type_metadata_settings` filter.
*/
if ( block_has_support( $block_type, array( 'filter', 'duotone' ), null ) ) {
if ( ! $block_type->attributes ) {
$block_type->attributes = array();
}
if ( ! array_key_exists( 'style', $block_type->attributes ) ) {
$block_type->attributes['style'] = array(
'type' => 'object',
);
}
}
}