- added fixes for WP5.8 version;

This commit is contained in:
Nikita Sinelnikov
2021-07-08 15:13:13 +03:00
parent 9a9c960d98
commit ccd5e09a0f
2 changed files with 11 additions and 5 deletions
+8 -3
View File
@@ -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;
+3 -2
View File
@@ -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;
}
}
}