mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- added fixes for WP5.8 version;
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user