Co-Authors Plus

Описание

Назначайте сразу несколько авторов к записям, страницам и произвольным типам записей с помощью удобной формы. Записи с соавторами появляются в архиве соавторов. Соавторы могут редактировать записи, с которыми они связаны, а соавторы, являющиеся участниками, могут редактировать записи только в том случае, если они не были опубликованы (по умолчанию).

Доблавяйте авторов без создания системных WordPress пользователей. Просто создайте гостевого автора и свяжите его с любой записью на сайте.

Используйте функции шаблона плагина, чтобы отобразить список авторов где угодно в теме.

Этот плагин – практически полностью переписанная версия плагина Co-Authors, созданного автором Weston Ruter в 2007 году. Код оригинального плагина вдохновлен разработкой Mark Jaquith: ‘Multiple Authors‘.

Refer to our wiki for detailed documentation.

Blocks

Co-Authors

Use this block to create a repeating template that displays the co-authors of a post. By default it contains the Co-Author Name block, but you can add any other block you want to the template. If you choose another Co-Author block like avatar, biography or image it will automatically be supplied the author context that it needs. This works similarly to creating a Post Template in a Query Loop block.

The Co-Authors Block supports two layouts:

Inline Layout

Use the inline layout to display co-authors in a list on a single wrapping line.

You can control the characters displayed before, between and after co-authors in the list using the block settings, or change the defaults using the following server-side filters:

`

coauthors_default_before
coauthors_default_between
coauthors_default_between_last
coauthors_default_after
`

Block Layout

Use the block layout to display co-authors in a vertical stack. While using the block layout you can use block spacing settings to control the vertical space between co-authors.

Then you can create your own layout using blocks like group, row or stack and it will be applied to each co-author, similar to applying a layout to each post in a query loop.

Co-Author Name

This block displays a co-author’s Display Name and optionally turns it into a link to their author archive.

Using the block’s advanced settings you can select which HTML element is used to output the name. This is useful in contexts such as an author archive where you might want their name to be a heading.

Co-Author Avatar

Like the post author avatar, or comment author avatar, this block displays a small scale square image of a co-author and utilizes the Gravatar default avatars as configured in your site’s discussion options.

To customize the available sizes, use the rest_avatar_sizes filter.

Co-Author Biography

This block outputs the biographical information for a co-author based on either their user or guest author data.

The content is wrapped in paragraph elements using wpautop and is escaped using wp_kses_post.

Co-Author Featured Image

This block requires the use of Guest Authors. Because guest author avatars are uploaded to the WordPress media library, there are more options for displaying these images.

This block utilizes the image sizes configured in your theme and your site’s media settings to present a guest author’s avatar at a larger scale or higher resolution. It does not support Gravatars.

Block Context

Post, Page, Query Loop

By default, all blocks receive the post context. The job of the Co-Authors Block is to use this context to find the relevant authors and provide context to its inner blocks.

Author Archive

If you want to display data about the author on their own archive, use the individual co-author blocks directly without wrapping them in the Co-Authors Block. During requests for an author archive the correct context is derived from the author_name query variable and provided to all blocks that declare their use of the context co-authors-plus/author.

Extending

If you make a custom block and want to use the author context, add co-authors-plus/author to the usesContext property in your block.json file.

Example:
json
{
"usesContext": ["co-authors-plus/author"]
}

Block Example Data

When working with Full Site Editing, or in the post editor before the authors are loaded, example data is used. The example data provided with the co-author blocks resembles a response to the /coauthors/v1/coauthors/:user-nicename REST API endpoint.

Extending

If you have written a plugin that modifies the REST API response, you can similarly modify the example data either on the server-side using the filter coauthors_blocks_store_data or the client-side using the filter co-authors-plus.author-placeholder.

Block Non-support

To declare a lack of support for Co-Author Plus blocks on your site, use the filter coauthors_plus_support_blocks to return false.

Скриншоты

  • Сразу несколько авторов можно добавить к записи, странице или произвольному типу записей с помощью интерфейса автозаполнения.
  • Гостевые авторы позволяют не создавать системных пользователей WordPress. Вы можете перезаписать мета-информацию существующих пользователей WordPress, связав их с гостевыми автороми.

Блоки

Этот плагин предоставляет 5 блоков.

  • Co-Author Avatar Displays a small scale version of a co-author's avatar. Utilizes fallbacks from Gravatar so everyone has an avatar.
  • Co-Authors Displays the co-authors of a post by using blocks to create a template. Start with co-author name and add any other co-author blocks.
  • Co-Author Name Displays a co-author's display name and optionally links to their author archive.
  • Co-Author Biography Displays a co-author's biographical description.
  • Co-Author Featured Image Uses your theme's image sizes to display a scalable avatar for a co-author with a guest author profile. Does not fallback to Gravatar images.

Установка

  1. IMPORTANT: If you are using the original Co-Authors plugin, disable it before installing Co-Authors Plus.
  2. Разархвириуйте файл coauthors-plus.zip и загрузите его содержимое в каталог /wp-content/plugins/. Вы также можете установить плагин напрямую из каталога WordPress.
  3. Активируйте плагин используя меню ‘Плагины’ в WordPress
  4. Разместите необходимые функции шаблона в файлы темы.
  5. Добавьте соавторов к вашим записям и страницам.

Часто задаваемые вопросы

Как я могу добавить плагин Co-Authors Plus в свою тему?

Если вы только что установили Co-Authors Plus, вы можете заметить, что авторы появились в панели администратора, но их нет на фронтенде. Вам необходимо добавить функции шаблона в файлы вашей темы самостоятельно.

Что происходит с записями и страницами, когда я удаляю пользователя, который назначен соавтором?

Когда пользователь удален, он также будет удален из всех записей, в которых он соавтор. Вы также можете переназначить автора при удалении.

Могу ли я использовать плагин Co-Authors Plus на мультисайтовой установке?

Да! Co-Authors Plus может быть активирован на каждом сайте отдельно или для всей сети. После создания гостевых авторов, они будут доступны на каждом сайте отдельно.

Какие нужны пользовательские разрешения?

A WordPress user will need the edit_others_posts capability to assign co-authors to posts. This is typically granted to the Editor role but can be altered with the coauthors_plus_edit_authors filter.

A WordPress user will need the list_users capability to create new guest author profiles. This is typically granted to the Administrator role but can be altered with the coauthors_guest_author_manage_cap filter.

Могу ли я легко создать список соавторов?

Да! Для этого есть функция шаблона coauthors_wp_list_authors(), которая принимает большинство аргументов функции wp_list_authors(). Подробности можно найти в файле template-tags.php.

Могу ли я отключить гостевых авторов?

Да! Гостевых авторов можно полностью отключить с помощью фильтра. Добавьте следующий код на событие init:
add_filter( ‘coauthors_guest_authors_enabled’, ‘__return_false’ )

Отзывы

05.01.2024
Simplemente si quieres agregar varios autores a una entrada o simplemente cambiarlos, este plugin lo soluciona de una manera excelente, intuitiva y sin tanto complique. Muchas gracias a los desarrolladores, me ha servido bastante. Los quiero mucho.
03.08.2023 1 ответ
After removing this plugin all my posts were broken and I had to recover site from a backup. Also the newly registered taxonomy here is not public, which leads to not being able to view other posts of a particular author. The plugin needs improvement.
29.11.2022
Plug-ins are supposed to plug-in and work. This one requires you to be a web developer to make it work. Even if you're a bit familiar with adding code to places with good instructions, this just has information for devs on how to install code - there's no list of instructions to follow. If this changes because there's nothing else out there, I'll come back and revise this review, but I've wasted way too long on this now.
18.06.2022
This plugin simply does not work anymore. No matter which author is chosen, whether singularity or co-habiting of a post, the admin user is always displayed, and no other author. It's a shame because this plugin was the best solution for administrating co-authors of posts, if you needed the option.
28.04.2022 1 ответ
I rarely ever give 1 star reviews, but developers who take over a plugin - making a breaking change that took a while to resolve - and then refuse to follow standard practice by providing a changelog (despite requests) for future updates, cannot be trusted. Avoid at all costs.
Посмотреть все 73 отзыва

Участники и разработчики

«Co-Authors Plus» — проект с открытым исходным кодом. В развитие плагина внесли свой вклад следующие участники:

Участники

«Co-Authors Plus» переведён на 15 языков. Благодарим переводчиков за их работу.

Перевести «Co-Authors Plus» на ваш язык.

Заинтересованы в разработке?

Посмотрите код, проверьте SVN репозиторий, или подпишитесь на журнал разработки по RSS.