: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
if ( ! $posts && $parsed_args['hide_empty'] ) {
$author = get_userdata( $author_id );
if ( $parsed_args['exclude_admin'] && 'admin' === $author->display_name ) {
if ( $parsed_args['show_fullname'] && $author->first_name && $author->last_name ) {
/* translators: 1: User's first name, 2: Last name. */
_x( '%1$s %2$s', 'Display name based on first name and last name' ),
$name = $author->display_name;
if ( ! $parsed_args['html'] ) {
continue; // No need to go further to process HTML.
if ( 'list' === $parsed_args['style'] ) {
'<a href="%1$s" title="%2$s">%3$s</a>',
esc_url( get_author_posts_url( $author->ID, $author->user_nicename ) ),
/* translators: %s: Author's display name. */
esc_attr( sprintf( __( 'Posts by %s' ), $author->display_name ) ),
if ( ! empty( $parsed_args['feed_image'] ) || ! empty( $parsed_args['feed'] ) ) {
if ( empty( $parsed_args['feed_image'] ) ) {
$link .= '<a href="' . get_author_feed_link( $author->ID, $parsed_args['feed_type'] ) . '"';
if ( ! empty( $parsed_args['feed'] ) ) {
$alt = ' alt="' . esc_attr( $parsed_args['feed'] ) . '"';
$name = $parsed_args['feed'];
if ( ! empty( $parsed_args['feed_image'] ) ) {
$link .= '<img src="' . esc_url( $parsed_args['feed_image'] ) . '" style="border: none;"' . $alt . ' />';
if ( empty( $parsed_args['feed_image'] ) ) {
if ( $parsed_args['optioncount'] ) {
$link .= ' (' . $posts . ')';
$return .= ( 'list' === $parsed_args['style'] ) ? '</li>' : ', ';
$return = rtrim( $return, ', ' );
if ( $parsed_args['echo'] ) {
* Determines whether this site has more than one author.
* Checks to see if more than one author has published posts.
* 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.
* @global wpdb $wpdb WordPress database abstraction object.
* @return bool Whether or not we have more than one author
function is_multi_author() {
$is_multi_author = get_transient( 'is_multi_author' );
if ( false === $is_multi_author ) {
$rows = (array) $wpdb->get_col( "SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 2" );
$is_multi_author = 1 < count( $rows ) ? 1 : 0;
set_transient( 'is_multi_author', $is_multi_author );
* Filters whether the site has more than one author with published posts.
* @param bool $is_multi_author Whether $is_multi_author should evaluate as true.
return apply_filters( 'is_multi_author', (bool) $is_multi_author );
* Helper function to clear the cache for number of authors.
function __clear_multi_author_cache() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore
delete_transient( 'is_multi_author' );