diff --git a/src/includes/class-wordlift.php b/src/includes/class-wordlift.php index 34e24e247..9028972e8 100644 --- a/src/includes/class-wordlift.php +++ b/src/includes/class-wordlift.php @@ -1698,7 +1698,9 @@ private function define_admin_hooks( $that ) { * @since 3.23.0 */ add_filter( - 'allowed_block_types', + version_compare( get_bloginfo( 'version' ), '5.8', '>=' ) + ? 'allowed_block_types_all' + : 'allowed_block_types', function ( $value ) { if ( true === $value ) { diff --git a/src/wordlift.php b/src/wordlift.php index d97bfe433..fc337aa1a 100644 --- a/src/wordlift.php +++ b/src/wordlift.php @@ -300,7 +300,13 @@ function wl_enqueue_leaflet( $in_footer = false ) { wp_enqueue_script( 'wl-leaflet', plugin_dir_url( __FILE__ ) . 'js/leaflet/leaflet.js', array(), '1.6.0', $in_footer ); } -add_filter( 'block_categories', 'wl_block_categories', 10 ); +add_filter( + version_compare( get_bloginfo( 'version' ), '5.8', '>=' ) + ? 'block_categories_all' + : 'block_categories', + 'wl_block_categories', + 10 +); // Temporary fix for a typo in WooCommerce Extension. add_filter(