Support » Plugin: Co-Authors Plus » Version 3.4 error in WP 4.9.10

  • I tried updating Co-Authors Plus to v3.4, on a site where I’m running WP 4.9.10, Genesis 2.10.1, and the front end immediately became upset with me.

    Here’s the error:

    Fatal error: Uncaught ArgumentCountError: Too few arguments to function CoAuthors_Plus::fix_author_page(), 0 passed in /wp-content/themes/news-pro/functions.php on line 130 and exactly 1 expected in /wp-content/plugins/co-authors-plus/co-authors-plus.php:1114 
    
    Stack trace: 
    #0 /wp-content/themes/news-pro/functions.php(130): CoAuthors_Plus->fix_author_page() 
    #1 /wp-includes/class-wp-hook.php(286): {closure}(NULL) 
    #2 /wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array) 
    #3 /wp-includes/plugin.php(453): WP_Hook->do_action(Array) 
    #4 /wp-includes/general-template.php(31): do_action('get_header', NULL) 
    #5 /wp-content/themes/genesis/lib/framewor in /wp-content/plugins/co-authors-plus/co-authors-plus.php on line 1114

    and the filter in question is one that I’ve had on several sites for a few years now, along with the Genesis Co-Authors Plus plugin (the one that fixes the author box for Genesis themes… not sure if it’s still needed either, but that plugin hasn’t been updated in quite some time)

    // Co-Authors author page fix
    add_action( 'get_header', function() {
    global $coauthors_plus;
    
    if ( is_object( $coauthors_plus ) && is_callable( array( $coauthors_plus, 'fix_author_page' ) ) ) {
    $coauthors_plus->fix_author_page();
    }
    } );

    Is the author page fix function not needed anymore? Or is there new code for it?

  • You must be logged in to reply to this topic.