| 开发者 |
palasthotel
edwardbock greatestview benjaminbirkenhake janaeggebrecht |
|---|---|
| 更新时间 | 2026年8月4日 21:14 |
| 捐献地址: | 去捐款 |
| PHP版本: | 5.0 及以上 |
| WordPress版本: | 7.0.2 |
| 版权: | GPL-3.0-or-later |
| 版权网址: | 版权信息 |
additional-authors-wordpress.zip to the /wp-content/plugins/ directoryAdditional Authors FolderBy default the plugin only stores them; the output is up to the theme, through
do_action( 'additional_authors_the_authors' ). Since 1.4.0 it can also extend the
byline a standard theme already renders:
add_filter( 'additional_authors_auto_byline', '__return_true' );
That covers the core/post-author and core/post-author-name blocks used by block
themes such as Twenty Twenty-Four and Twenty Twenty-Five, and the the_author() and
the_author_posts_link() template tags used by classic themes. It is off by default,
because a plugin update should not change what your site outputs.
Two things worth knowing:
get_the_author() in a
link they build themselves. The additional names then sit inside that link, which
points at the main author. If per-author links matter to you, output them yourself
with do_action( 'additional_authors_the_authors_posts_links' ) instead.core/post-author block is left untouched when its "Show bio" option is on: a
biography belongs to one person, and listing several names above it would read as if
it described all of them.additional_authors_byline_separator sets the separator (default ,), and
additional_authors_byline_suffix lets you build the whole appended string, for
example to get "Anna, Mark und David":
add_filter( 'additional_authors_byline_suffix', function ( $suffix, $ids ) { $names = array_map( fn( $id ) => get_the_author_meta( 'display_name', $id ), $ids ); $last = array_pop( $names ); return ( $names ? ', ' . implode( ', ', $names ) : '' ) . ' und ' . $last; }, 10, 2 );