Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Turns out this resulted in another error in inc-setup/dashboard.php. I replaced the loop in lines 150-177 with this code:

    foreach ( (array) $wp_meta_boxes['dashboard'] as $context => $datas ) {
    
    foreach ( (array) $datas as $priority => $data ) {
    
    foreach ( (array) $data as $widget => $value ) {
    
    // Use a temporary variable for title manipulation
    
    $title = isset($value['title']) ? $value['title'] : '';
    
    // Convert boolean false to an empty string
    
    if ($title === FALSE) {
    
    $title = '';
    
    }
    
    // If title is an array, reset to empty string
    
    if (is_array($title)) {
    
    $title = '';
    
    }
    
    $widgets[$widget] = array(
    
    'id' => $widget,
    
    'title' => strip_tags(
    
    preg_replace('/( |)<span.*span>/im', '', $title)
    
    ),
    
    'context' => $context,
    
    'priority' => $priority,
    
    );
    
    }
    
    }
    
    }

    Enclosing line 285 in an if statement and checking if $post is set resolves the issue. Necessary code below. Replace line 285 of adminimize.php with the entire code.

    What is the best way to get that included in the next official release?

        // Ensure $post is set and not null before accessing its properties
        if ( isset( $post ) && $post !== null ) {
            $current_post_type = get_post_type($post->ID);   // current line 285
        } else {
            // Fallback logic if $post is not set or is null
            $current_post_type = null;
        }

    It works!

    What a relief! I had been dealing with this for hours.

    Thank you! Thank you! Thank you!

    Same problem for me, using the most recent Avada theme 2.0.6

Viewing 4 replies - 1 through 4 (of 4 total)