Making WordPress.org


Ignore:
Timestamp:
07/17/2020 04:39:41 AM (4 years ago)
Author:
dd32
Message:

WordPress.org SEO: Avoid a PHP Notice when archives of non-existent users are requested.
is_author() is true, but get_queried_object() will be false.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/canonical.php

    r9991 r10077  
    105105    } elseif ( is_search() ) {
    106106        $url = home_url( 'search/' . urlencode( get_query_var( 's' ) ) . '/' );
    107     } elseif ( is_author() ) {
    108         // On WordPress.org get_author_posts_url() returns profile.wordpress.org links. Build it manually.
     107    } elseif ( is_author() && $queried_object instanceOf \WP_User ) {
     108        // On WordPress.org get_author_posts_url() returns profile.wordpress.org links. Build it manually
    109109        $url = home_url( 'author/' . $queried_object->user_nicename . '/' );
    110110    } elseif ( is_post_type_archive() ) {
Note: See TracChangeset for help on using the changeset viewer.