WP_Query::is_author( int|string|int[]|string[] $author = '' ): bool

In this article

Determines whether the query is for an existing author archive page.

Description

If the $author parameter is specified, this function will additionally check if the query is for one of the authors specified.

Parameters

$authorint|string|int[]|string[]optional
User ID, nickname, nicename, or array of such to check against.

Default:''

Return

bool Whether the query is for an existing author archive page.

Source

	}
	return false;
}

/**
 * Determines whether the query is for an existing archive page.
 *
 * Archive pages include category, tag, author, date, custom post type,
 * and custom taxonomy based archives.
 *
 * @since 3.1.0
 *
 * @see WP_Query::is_category()
 * @see WP_Query::is_tag()
 * @see WP_Query::is_author()
 * @see WP_Query::is_date()
 * @see WP_Query::is_post_type_archive()
 * @see WP_Query::is_tax()
 *
 * @return bool Whether the query is for an existing archive page.
 */
public function is_archive() {
	return (bool) $this->is_archive;
}

/**

Changelog

VersionDescription
3.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.