diff --git a/includes/admin/core/class-admin-enqueue.php b/includes/admin/core/class-admin-enqueue.php index bae17427..c6832df4 100644 --- a/includes/admin/core/class-admin-enqueue.php +++ b/includes/admin/core/class-admin-enqueue.php @@ -83,7 +83,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) { add_action( 'load-post-new.php', array( &$this, 'enqueue_cpt_scripts' ) ); add_action( 'load-post.php', array( &$this, 'enqueue_cpt_scripts' ) ); - add_filter( 'block_categories', array( &$this, 'blocks_category' ), 10, 2 ); + global $wp_version; + if ( version_compare( $wp_version, '5.8-rc.1', '>=' ) ) { + add_filter( 'block_categories_all', array( &$this, 'blocks_category' ), 10, 2 ); + } else { + add_filter( 'block_categories', array( &$this, 'blocks_category' ), 10, 2 ); + } } @@ -527,11 +532,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) { * Add Gutenberg category for UM shortcodes * * @param array $categories - * @param $post + * @param \WP_Block_Editor_Context $context * * @return array */ - function blocks_category( $categories, $post ) { + function blocks_category( $categories, $context ) { $enable_blocks = UM()->options()->get( 'enable_blocks' ); if ( empty( $enable_blocks ) ) { return $categories; diff --git a/includes/widgets/class-um-search-widget.php b/includes/widgets/class-um-search-widget.php index 4ab48476..6c429757 100644 --- a/includes/widgets/class-um-search-widget.php +++ b/includes/widgets/class-um-search-widget.php @@ -41,7 +41,8 @@ class UM_Search_Widget extends \WP_Widget { */ public function widget( $args, $instance ) { - $title = apply_filters( 'widget_title', $instance['title'] ); + $title = array_key_exists( 'title', $instance ) ? $instance['title'] : ''; + $title = apply_filters( 'widget_title', $title ); // before and after widget arguments are defined by themes echo $args['before_widget']; @@ -107,4 +108,4 @@ class UM_Search_Widget extends \WP_Widget { return $instance; } -} \ No newline at end of file +}