This page is a reference for the hooks that Co-Authors Plus provides. It is generated by reading the source, so if you find something out of date, grep for apply_filters and do_action in the repo and please open a PR.
File paths are relative to the plugin root.
Text placed before a list of co-authors. Defaults to 'By '.
- Type:
string - Used in: template tags and the Co-Authors block
- Files:
template-tags.php,php/blocks/block-coauthors/class-block-coauthors.php
Separator between co-authors (all but the last). Defaults to ', '.
Separator before the final co-author. Defaults to ' and '.
Text placed after a list of co-authors. Defaults to ''.
Arguments used to render a single co-author's posts-link (text, title, url). Filter the array to customise the markup emitted by coauthors_posts_links().
- Parameters:
array $args,stdClass $author - File:
template-tags.php
The ordered array of authors before coauthors_wp_list_authors() renders them. Use this to filter the listing rather than post-process the output.
- File:
template-tags.php
The resolved co-authors for a post. Runs after the plugin's lookup but before any display logic.
- Parameters:
array $coauthors,int $post_id - File:
template-tags.php
The Open Graph tags the plugin contributes to the document head.
- File:
php/class-coauthors-plus.php
Post types that Co-Authors Plus attaches to. Defaults to the list of registered public post types.
- Parameters:
array $post_types - File:
php/class-coauthors-plus.php
Post types counted towards a co-author's published post count.
- Parameters:
array $post_types(defaults to[ 'post' ]) - Files:
php/class-coauthors-plus.php(two call sites)
The WP_User used as the default author when a post has none. Defaults to the current user.
Whether to combine the post_author column query with the taxonomy query. Returning false switches to a simpler taxonomy-only query on sites where post_author isn't reliable.
Whether the current user can assign co-authors to posts. Defaults to edit_others_posts.
- File:
php/class-coauthors-plus.php
Capability required to appear in the co-author search results. Defaults to edit_posts.
Array of user logins hidden from the co-author search results.
Whether the guest authors feature is active. Return false to disable entirely.
Whether to force guest authors even when the feature would otherwise be skipped.
Capability required to manage guest authors. Defaults to list_users.
Admin menu parent under which the Guest Authors UI appears. Defaults to users.php.
Array of field definitions rendered on the guest author profile screen.
- Parameters:
array $fields,array $groups - File:
php/class-coauthors-guest-authors.php
Sortable columns in the Guest Authors list table.
WP_Query args used to list guest authors in the admin.
Columns shown on the Guest Authors list table.
Row actions shown below each guest author in the list table.
Whether to show the "Create profile" link on user edit screens. Defaults to false.
Extra data to include when exporting a guest author's personal data (WordPress privacy tools).
Dynamic filter per name field, used to switch input types on the guest author profile form.
Title of the Authors meta box. Defaults to Authors.
Where the meta box appears (normal, side, advanced). Defaults to side.
Meta box priority. Defaults to high.
Return false to stop Co-Authors Plus from registering its blocks. Useful when a site wants to hide them from the inserter.
- File:
php/blocks/class-blocks.php
Server-side example data passed to block editor placeholders when no authors are loaded yet.
Client-side equivalent of coauthors_blocks_store_data. Applied via @wordpress/hooks.
- File:
src/blocks-store/index.js
Schema for a single co-author resource returned by the REST controller.
- File:
php/api/endpoints/class-coauthors-controller.php
The WP_REST_Response for a single co-author, after the default preparation. Use this to add custom fields.
- Parameters:
WP_REST_Response $response,object $author,WP_REST_Request $request
Label for an author option in the sidebar autocomplete. Defaults to "{displayName} | {email}".
- Parameters:
string $label,object $author - File:
src/utils.js
Number of characters before the sidebar autocomplete begins searching. Defaults to 2.
- File:
src/components/co-authors/index.jsx
Fires after a guest author is created via the admin UI.
- File:
php/class-coauthors-guest-authors.php
Fires after a guest author is deleted.
Fires while rendering a custom column for a guest author row.
- Parameters:
string $column_name,int $author_id - File:
php/class-coauthors-wp-list-table.php
Deprecated in 4.0 when triggered from a REST save. Use the set_object_terms action on the author taxonomy instead. See Upgrading to 4.0.
Deprecated in 4.0 when triggered from a REST save. Same replacement as above.