is_author example

'who'                     => '',
        'include_selected'        => false,
        'option_none_value'       => -1,
        'role'                    => '',
        'role__in'                => array(),
        'role__not_in'            => array(),
        'capability'              => '',
        'capability__in'          => array(),
        'capability__not_in'      => array(),
    );

    $defaults['selected'] = is_author() ? get_query_var( 'author' ) : 0;

    $parsed_args = wp_parse_args( $args$defaults );

    $query_args = wp_array_slice_assoc(
        $parsed_args,
        array(
            'blog_id',
            'include',
            'exclude',
            'orderby',
            'order',
            

function rest_get_queried_resource_route() {
    if ( is_singular() ) {
        $route = rest_get_route_for_post( get_queried_object() );
    } elseif ( is_category() || is_tag() || is_tax() ) {
        $route = rest_get_route_for_term( get_queried_object() );
    } elseif ( is_author() ) {
        $route = '/wp/v2/users/' . get_queried_object_id();
    } else {
        $route = '';
    }

    /** * Filters the REST route for the currently queried object. * * @since 5.5.0 * * @param string $link The route with a leading slash, or an empty string. */
if ( $redirect_url ) {
                    $redirect['query'] = remove_query_arg( array( 'year', 'monthnum' )$redirect['query'] );
                }
            } elseif ( is_year() && ! empty( $_GET['year'] ) ) {
                $redirect_url = get_year_link( $year );

                if ( $redirect_url ) {
                    $redirect['query'] = remove_query_arg( 'year', $redirect['query'] );
                }
            }
        } elseif ( is_author() && ! empty( $_GET['author'] ) && preg_match( '|^[0-9]+$|', $_GET['author'] ) ) {
            $author = get_userdata( get_query_var( 'author' ) );

            if ( false !== $author
                && $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE $wpdb->posts.post_author = %d AND $wpdb->posts.post_status = 'publish' LIMIT 1", $author->ID ) )
            ) {
                $redirect_url = get_author_posts_url( $author->ID, $author->user_nicename );
                $redirect_obj = $author;

                if ( $redirect_url ) {
                    $redirect['query'] = remove_query_arg( 'author', $redirect['query'] );
                }
            }
$classes[] = 'parent-pageid-' . $post->post_parent;
            }
        }
    } elseif ( is_archive() ) {
        if ( is_post_type_archive() ) {
            $classes[] = 'post-type-archive';
            $post_type = get_query_var( 'post_type' );
            if ( is_array( $post_type ) ) {
                $post_type = reset( $post_type );
            }
            $classes[] = 'post-type-archive-' . sanitize_html_class( $post_type );
        } elseif ( is_author() ) {
            $author    = $wp_query->get_queried_object();
            $classes[] = 'author';
            if ( isset( $author->user_nicename ) ) {
                $classes[] = 'author-' . sanitize_html_class( $author->user_nicename, $author->ID );
                $classes[] = 'author-' . $author->ID;
            }
        } elseif ( is_category() ) {
            $cat       = $wp_query->get_queried_object();
            $classes[] = 'category';
            if ( isset( $cat->term_id ) ) {
                $cat_class = sanitize_html_class( $cat->slug, $cat->term_id );
                
$GLOBALS['query_string'] = $this->query_string;
        $GLOBALS['posts']        = & $wp_query->posts;
        $GLOBALS['post']         = isset( $wp_query->post ) ? $wp_query->post : null;
        $GLOBALS['request']      = $wp_query->request;

        if ( $wp_query->is_single() || $wp_query->is_page() ) {
            $GLOBALS['more']   = 1;
            $GLOBALS['single'] = 1;
        }

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

    /** * Set up the current user. * * @since 2.0.0 */
    public function init() {
        wp_get_current_user();
    }

function is_author( $author = '' ) {
    global $wp_query;

    if ( ! isset( $wp_query ) ) {
        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );
        return false;
    }

    return $wp_query->is_author( $author );
}

/** * Determines whether the query is for an existing category archive page. * * If the $category parameter is specified, this function will additionally * check if the query is for one of the categories specified. * * For more information on this and similar theme functions, check out * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ * Conditional Tags} article in the Theme Developer Handbook. * * @since 1.5.0 * * @global WP_Query $wp_query WordPress Query object. * * @param int|string|int[]|string[] $category Optional. Category ID, name, slug, or array of such * to check against. Default empty. * @return bool Whether the query is for an existing category archive page. */

    } elseif ( is_home() || is_singular() ) {
        $title['title'] = single_post_title( '', false );

        // If on a category or tag archive, use the term title.     } elseif ( is_category() || is_tag() ) {
        $title['title'] = single_term_title( '', false );

        // If on an author archive, use the author's display name.     } elseif ( is_author() && get_queried_object() ) {
        $author         = get_queried_object();
        $title['title'] = $author->display_name;

        // If it's a date archive, use the date as the title.     } elseif ( is_year() ) {
        $title['title'] = get_the_date( _x( 'Y', 'yearly archives date format' ) );

    } elseif ( is_month() ) {
        $title['title'] = get_the_date( _x( 'F Y', 'monthly archives date format' ) );

    } elseif ( is_day() ) {
        
Home | Imprint | This part of the site doesn't use cookies.