Wordpress 6.5.4: Disable colors in core/paragaph block

raw

README.rst

Disabling gradients is important - otherwise the background color would still be selectable.

raw

functions.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
function mytheme_block_type_metadata_settings($settings, $metadata)
{
    if ($settings['name'] == 'core/paragraph') {
        $settings['supports']['color']['background'] = false;
        $settings['supports']['color']['gradients'] = false;
        $settings['supports']['color']['text'] = false;
    }
 
    return $settings;
}
 
 
add_filter('block_type_metadata_settings', 'mytheme_block_type_metadata_settings', 10, 2);
raw

z-gutenberg-background-color.png

z-gutenberg-background-color.png
Christian Weiske Christian Weiske
owner

History