• Resolved gjyshi

    (@gjyshi)


    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 7 months ago by gjyshi.
Viewing 1 replies (of 1 total)
  • Thread Starter gjyshi

    (@gjyshi)

    sorry I just changed UM()->options()->option to UM()->options()->update and everything worked fine.

Viewing 1 replies (of 1 total)
  • The topic ‘Custom tab not working after 3.1 update’ is closed to new replies.