From ec4afa649d1071502d14543a654d40020bd162af Mon Sep 17 00:00:00 2001 From: Kelly Dwan Date: Tue, 1 Oct 2019 13:45:31 -0400 Subject: [PATCH] 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. --- themes/wporg-5ftf/functions.php | 34 +++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/themes/wporg-5ftf/functions.php b/themes/wporg-5ftf/functions.php index 7588c1d..a5278ec 100644 --- a/themes/wporg-5ftf/functions.php +++ b/themes/wporg-5ftf/functions.php @@ -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. }