is_multi_author()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
is_multi_author(): bool
Описание
Проверяет, публиковали ли записи более одного автора.
Подробнее об этой и подобных функциях темы см. статью Conditional Tags в Theme Developer Handbook.
Оригинал (английский)
Checks to see if more than one author has published posts.
For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.
Возвращаемое значение
bool
Исходный код
wp-includes/author-template.php:619
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 );
}
История изменений
| Версия | Описание |
|---|---|
| 3.2.0 | Introduced. |

