• Hello,

    After WordPress core update to 5.7, our author archive page stopped working, and $wp_query is_author() and is_archive() return false, however they are supposed to return true. I dug more on wp core updates and found out the issue is caused by below code:

    wp-includes/class-wp.php > function register_globals()
    WordPress 5.7.0

    if ( $wp_query->is_author() ) {
    	$GLOBALS['authordata'] = get_userdata( get_queried_object_id() ); 
    }

    WordPress 5.6.4

    if ( $wp_query->is_author() ) {
           $GLOBALS['authordata'] = get_userdata( $wp_query->post->post_author ); 
    }

    The get_queried_object_id() returned user’s co-author id, which makes get_userdata( get_queried_object_id() ) returned false and the author archive page not working properly.

    And $wp_query->post->post_author returned user’s WordPress account id, which gives us what we need.

    Can you please advise what we can do to fix this issue instead of change WordPress core code? Any advice is highly appreciated.

    Thank you

    The page I need help with: [log in to see the link]

  • The topic ‘Author archive page not working properly’ is closed to new replies.