Custom tab not working after 3.1 update

[ad_1]

Fatal error: Uncaught Error: Cannot access private property um\core\Options::$options in

Im getting the above error and my custom tab code is below

this is my code I don’t know why is wrong

add_filter( 'um_profile_tabs', function ( $tabs ) {
unset($tabs['comments']);
if ( array_key_exists( 'posts', $tabs ) ) {
$tabs['posts'] = array(
'name' => 'Video',
'icon' => 'um-icon-ios-videocam',
'custom' => true
);
}
return $tabs;
}, 810 );

function um_upload_tab_add_tab( $tabs ) {
$tabs[ 'upload_tab' ] = array(
'name' => 'Upload',
'icon' => 'um-faicon-upload',
'custom' => true,
);

UM()->options()->options[ 'profile_tab_' . 'upload_tab' ] = true;

return $tabs;
}

/**
* Render tab content
*
* @param array $args
*/
function um_profile_content_upload_tab_default() {
echo do_shortcode('[upload]');
}

function um_profile_upload_tab_current_user() {
$author = um_profile_id();
$current_user = wp_get_current_user();
if($author != $current_user->user_nicename) {
add_action( 'um_profile_content_upload_tab_default', 'um_profile_content_upload_tab_default' );
add_filter( 'um_profile_tabs', 'um_upload_tab_add_tab', 1000 );
}
}
add_action('init', 'um_profile_upload_tab_current_user');

// Hide the child theme notice.
add_action( 'admin_init', function() {
if ( function_exists( 'UM' ) ) {
UM()->admin()->notices()->remove_notice( 'um_is_not_child_theme' );
}
}, 20 );

How to fix this thanks.

  • This topic was modified 2 hours, 9 minutes ago by gjyshi.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer