Check that register_block_style exists

This function is not in core WordPress yet, so we should check for it in case Gutenberg is deactivated.
This commit is contained in:
Kelly Dwan 2019-10-01 13:45:31 -04:00
parent 30b7c0786e
commit ec4afa649d
No known key found for this signature in database
GPG key ID: 8BA5575F3D11575D

View file

@ -60,23 +60,25 @@ function setup() {
)
);
register_block_style(
'core/group',
array(
'name' => 'wporg-parallelogram',
'label' => __( 'Parallelogram', 'wporg-5ftf' ),
'style_handle' => 'wporg-style',
)
);
if ( function_exists( 'register_block_style' ) ) {
register_block_style(
'core/group',
array(
'name' => 'wporg-parallelogram',
'label' => __( 'Parallelogram', 'wporg-5ftf' ),
'style_handle' => 'wporg-style',
)
);
register_block_style(
'core/paragraph',
array(
'name' => 'wporg-tldr',
'label' => __( 'Summary paragraph', 'wporg-5ftf' ),
'style_handle' => 'wporg-style',
)
);
register_block_style(
'core/paragraph',
array(
'name' => 'wporg-tldr',
'label' => __( 'Summary paragraph', 'wporg-5ftf' ),
'style_handle' => 'wporg-style',
)
);
}
// todo also setup block styles for other things, like the quote symbol, etc.
}