I'm wondering if there is a way to remove the typography and custom color panels from the sidebar for just the paragraph block.
I've currently written a function that I've added add_theme_support to for the typography panel and custom color picker but it's affecting every block that can utilize those things. Here is said function:
public function typography_custom_color_theme_support() {
// Disable Custom Color Picker
add_theme_support( 'editor-color-palette' );
add_theme_support( 'disable-custom-colors' );
// Disable Font Size and Custom Font Size Dropdowns
add_theme_support( 'editor-font-sizes' );
add_theme_support( 'disable-custom-font-sizes' );
}
If possible, could I add a conditional to this along the lines of "if paragraph block is selected run add_theme_support actions?"
Thank you.
theme.json
? What you're dealing with is a sub-set of the global styles system, which is heavily influenced bytheme.json
, if you don't have that file in your theme then you're opting out of the majority of the configuration options available, including some per-block/variation/style options