WP_REST_Comments_Controller::check_assign_author_permission │ protected │ WP 7.1.5

Checks whether the current user can attribute a comment to another user.

Метод класса: WP_REST_Comments_Controller{}

Хуков нет.

Возвращает

bool. Whether the comment can be attributed to the user.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->check_assign_author_permission( $author_id );
$author_id(int) (обязательный)
ID of the user the comment is being attributed to.

Список изменений

С версии 7.1.5 Введена.

Код WP_REST_Comments_Controller::check_assign_author_permission() WP 7.1.5

protected function check_assign_author_permission( $author_id ) {
	return current_user_can( 'moderate_comments' ) && is_user_member_of_blog( $author_id );
}