is_multi_author

The timeline below displays how wordpress function is_multi_author has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.3

/**
 * 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.
 *
 * @since 3.2.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether or not we have more than one author
 */
function is_multi_author()
{
    global $wpdb;
    $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.
     *
     * @since 3.2.0
     *
     * @param bool $is_multi_author Whether $is_multi_author should evaluate as true.
     */
    return apply_filters('is_multi_author', (bool) $is_multi_author);
}

WordPress Version: 5.1

/**
 * 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.
 *
 * @since 3.2.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether or not we have more than one author
 */
function is_multi_author()
{
    global $wpdb;
    if (false === $is_multi_author = get_transient('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.
     *
     * @since 3.2.0
     *
     * @param bool $is_multi_author Whether $is_multi_author should evaluate as true.
     */
    return apply_filters('is_multi_author', (bool) $is_multi_author);
}

WordPress Version: 5.0

/**
 * 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.
 * 
 * @since 3.2.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether or not we have more than one author
 */
function is_multi_author()
{
    global $wpdb;
    if (false === $is_multi_author = get_transient('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.
     *
     * @since 3.2.0
     *
     * @param bool $is_multi_author Whether $is_multi_author should evaluate as true.
     */
    return apply_filters('is_multi_author', (bool) $is_multi_author);
}

WordPress Version: 4.6

/**
 * Does this site have more than one author
 *
 * Checks to see if more than one author has published posts.
 *
 * @since 3.2.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether or not we have more than one author
 */
function is_multi_author()
{
    global $wpdb;
    if (false === $is_multi_author = get_transient('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.
     *
     * @since 3.2.0
     *
     * @param bool $is_multi_author Whether $is_multi_author should evaluate as true.
     */
    return apply_filters('is_multi_author', (bool) $is_multi_author);
}

WordPress Version: 4.4

/**
 * Does this site have more than one author
 *
 * Checks to see if more than one author has published posts.
 *
 * @since 3.2.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether or not we have more than one author
 */
function is_multi_author()
{
    global $wpdb;
    if (false === $is_multi_author = get_transient('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);
    }
    /**
     * Filter whether the site has more than one author with published posts.
     *
     * @since 3.2.0
     *
     * @param bool $is_multi_author Whether $is_multi_author should evaluate as true.
     */
    return apply_filters('is_multi_author', (bool) $is_multi_author);
}

WordPress Version: 4.3

/**
 * Does this site have more than one author
 *
 * Checks to see if more than one author has published posts.
 *
 * @since 3.2.0
 *
 * @global wpdb $wpdb
 *
 * @return bool Whether or not we have more than one author
 */
function is_multi_author()
{
    global $wpdb;
    if (false === $is_multi_author = get_transient('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);
    }
    /**
     * Filter whether the site has more than one author with published posts.
     *
     * @since 3.2.0
     *
     * @param bool $is_multi_author Whether $is_multi_author should evaluate as true.
     */
    return apply_filters('is_multi_author', (bool) $is_multi_author);
}

WordPress Version: 3.7

/**
 * Does this site have more than one author
 *
 * Checks to see if more than one author has published posts.
 *
 * @since 3.2.0
 * @return bool Whether or not we have more than one author
 */
function is_multi_author()
{
    global $wpdb;
    if (false === $is_multi_author = get_transient('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);
    }
    /**
     * Filter whether the site has more than one author with published posts.
     *
     * @since 3.2.0
     *
     * @param bool $is_multi_author Whether $is_multi_author should evaluate as true.
     */
    return apply_filters('is_multi_author', (bool) $is_multi_author);
}