Forum Replies Created

Viewing 1 replies (of 1 total)
  • I managed to solve it by editing my plugin file that had an error

    Fatal error: Uncaught Error: Attempt to assign property “title” on null
    in ../ultimate-dashboard/modules/setting/class-setting-output.php on line 165

    Before:

    /**
    * Change Howdy text.
    *
    * @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance.
    */
    public function change_howdy_text( $wp_admin_bar ) {

    $settings = get_option( 'udb_settings' );

    if ( empty( $settings['howdy_text'] ) ) {
    return;
    }

    $my_account = $wp_admin_bar->get_node( 'my-account' );

    $my_account->title = str_ireplace( 'Howdy', esc_html( $settings['howdy_text'] ), $my_account->title );

    $wp_admin_bar->remove_node( 'my-account' );

    $wp_admin_bar->add_node( $my_account );

    $my_account = $wp_admin_bar->get_node( 'my-account' );

    }

    After:

    /**
    * Change Howdy text.
    *
    * @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance.
    */
    public function change_howdy_text( $wp_admin_bar ) {

    $settings = get_option( 'udb_settings' );

    if ( empty( $settings['howdy_text'] ) ) {
    return;
    }

    $my_account = $wp_admin_bar->get_node( 'my-account' );

    if ( null !== $my_account ) {
    $my_account->title = str_ireplace( 'Howdy', esc_html( $settings['howdy_text'] ), $my_account->title );

    $wp_admin_bar->remove_node( 'my-account' );
    $wp_admin_bar->add_node( $my_account );
    }
    }

    Fix my error

    Note the before and after in the code if it is the same error it will be corrected

    Check if this problem is the same on line 165 of the file class-setting-output.php

Viewing 1 replies (of 1 total)