Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
alecgeatches committed Apr 22, 2024
2 parents 33ae3b0 + 586e803 commit 2f124f4
Show file tree
Hide file tree
Showing 173 changed files with 52,408 additions and 40,286 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cs-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
# Validate the composer.json file.
# @link https://getcomposer.org/doc/03-cli.md#validate
- name: Validate Composer installation
run: composer validate --no-check-all
run: composer validate --no-check-all --strict

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/.phpunit.cache/
/node_modules/
/vendor/
/.phpcs.xml
/.phpunit.result.cache
/composer.lock
/phpcs.xml
/phpunit.xml
Expand Down
43 changes: 35 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,32 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.6.0] - 2024-04-22

### Added
* Blocks for Co-Authors #997

### Fixed
* Improve alignment in author-selection component #990
* Fix admin notice positions #1002
* UI: Add capability check to Add New button #1003
* i18n: set script translations and refresh language files #1007

### Maintenance
* Docs: Consolidate and refresh README.md #992
* Refresh package.json #993
* NPM: Add version-bump-prompt #994
* Fix/general code tidy #995
* Composer: Use 4-space tab indentation #999
* Improve tests structure #1000
* Extract iterator class from template-tags.php #1005
* Add supported_post_types() method #1006
* Tests improvements #1008
* Bump postcss from 8.4.19 to 8.4.31 #1009
* Create co-authors-plus-da_DK.po #1013
* Increase minimum supported PHP version to 7.4 #954
* Increase minimum supported WordPress version to 5.7 #955

## [3.5.15] - 2023-08-28

### Fixed
Expand All @@ -20,7 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* i18n: Add text domain header #984

### Maintenance
* CI: Update integration tests environnments #979
* CI: Update integration tests environments #979
* CLI: Add Behat functional tests #980
* Create LICENSE file #985
* Refresh plugin headers #986
Expand Down Expand Up @@ -148,7 +174,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Adjust regex on posts_where_filter to be less greedy #686
* Update deprecated GitHub hosted runner #808
* Replace deprecated jQuery shorthand methods #812
* Switch guest author metabox to aside context #746
* Switch guest author meta box to aside context #746

**3.4.8 (June 15, 2021)**
* Fix AJAX author autocomplete when no author to post in author selector #803
Expand Down Expand Up @@ -203,7 +229,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* New filter `get_avatar_url()` to show avatar in JS selection #621
* New parameter in `coauthors_wp_list_authors()` to only query authors with posts #496
* Add internationalization support to title and name in author archives #516
* Add safelist to skip irrelevant capabilities during permission checks #543
* Add safe list to skip irrelevant capabilities during permission checks #543
* Add helper function `get_guest_author_post_count()` #605
* Add parameter for outputting HTML classes in `coauthors_get_avatar()` template tag #610
* Add `--append_coauthors` flag to synopsis of CLI `assign-coauthors` #600
Expand Down Expand Up @@ -328,7 +354,7 @@ Props to the many people who helped make this release possible: [catchmyfame](ht

**3.0.5 (Feb. 18, 2013)**
* New filter `coauthors_search_authors_get_terms_args` allows you to increase the number of matches returned with AJAX co-author selection
* Bug fix: If there isn't an author term yet for a co-author, avoid an erronous join that caused duplicate posts to appear.
* Bug fix: If there isn't an author term yet for a co-author, avoid an erroneous join that caused duplicate posts to appear.

**3.0.4 (Jan. 6, 2013)** =
* Support for automatically adding co-authors to your feeds. Props [cfg](https://github.com/cfg).
Expand All @@ -351,15 +377,15 @@ Props to the many people who helped make this release possible: [catchmyfame](ht
* Minor UI enhancements for guest authors

**3.0 (Nov. 12, 2012)**
* Create guest author profiles for bylines you'd like to assign without creating WordPress user accounts. Guest authors can have all of the same fields as normal users including display name, biography, and avatars.
* Create guest author profiles for bylines you'd like to assign without creating WordPress user accounts. Guest authors can have all the same fields as normal users including display name, biography, and avatars.
* Support for non-Latin characters in usernames and guest author names
* wp-cli subcommands for creating, assigning, and reassigning co-authors
* For themes using core template tags like `the_author()` or `the_author_posts_link()`, you enable Co-Authors Plus support with a simple filter
* New author terms are now prefixed with `cap-` to avoid collisions with global scope
* Bug fix: Apply query filters to only `post_types` registered with the taxonomy. Props [Tom Ransom](https://github.com/1bigidea)
* Filter `coauthors_posts_link_single()` with `coauthors_posts_link`. Also adds `rel="author"`. Props [Amit Sannad](https://github.com/asannad) and [Gabriel Koen](https://github.com/mintindeed)
* Filter for the context and priorities of the Co-Authors meta boxes. Props [Tomáš Kapler](https://github.com/tkapler)
* Renamed the post meta box for selecting authors so it applies to many post types. Props [John Blackbourn](https://github.com/johnbillion)
* Renamed the post meta box for selecting authors, so it applies to many post types. Props [John Blackbourn](https://github.com/johnbillion)

**2.6.4 (May 7, 2012)**
* Bug fix: Properly filter the user query so users can AJAX search against the display name field again
Expand Down Expand Up @@ -388,7 +414,7 @@ Props to the many people who helped make this release possible: [catchmyfame](ht
**2.6 (Dec. 22, 2011)**
* Sortable authors: Drag and drop the order of the authors as you'd like them to appear ([props kingkool68](http://profiles.wordpress.org/users/kingkool68/))
* Search for authors by display name (instead of nicename which was essentially the same as user_login)
* Option to remove the first author when there are two or more so it's less confusing
* Option to remove the first author when there are two or more, so it's less confusing
* Bumped requirements to WordPress 3.1
* Bug fix: Update the published post count for each user more reliably

Expand Down Expand Up @@ -425,7 +451,7 @@ Props to the many people who helped make this release possible: [catchmyfame](ht
* All authors of a post are now notified on a new comment
* Various javascript enhancements
* New option to allow subscribers to be added as authors
* All Authors can edit they posts of which they are co-authors
* All Authors can edit the posts of which they are co-authors
* FIX: Issues with `wp_coauthors_list` function
* FIX: Issues with coauthored posts not showing up on author archives

Expand Down Expand Up @@ -462,6 +488,7 @@ Props to the many people who helped make this release possible: [catchmyfame](ht
**1.1.0 (Apr. 14, 2009)**
* Initial beta release.

[3.6.0]: https://github.com/automattic/co-authors-plus/compare/3.5.15...3.6.0
[3.5.15]: https://github.com/automattic/co-authors-plus/compare/3.5.14...3.5.15
[3.5.14]: https://github.com/automattic/co-authors-plus/compare/3.5.13...3.5.14
[3.5.13]: https://github.com/automattic/co-authors-plus/compare/3.5.12...3.5.13
Expand Down
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Contributing to Co-Authors Plus

## Pull Requests

Please make pull requests against the `develop` branch.

Ideally include tests.

## Terminology: co-author vs coauthor

If talking about co-authors in a documentation, DocBlock, comment, or user-facing string, please include the hyphen.

Variables, constants, class, trait, interface, function, method, hook, and other programmatic names can all use no-hyphen.
139 changes: 130 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
# Co-Authors Plus

* Contributors: batmoo, danielbachhuber, automattic, GaryJ
* Tags: authors, users, multiple authors, co-authors, multi-author, publishing
* Requires at least: 4.1
* Tested up to: 6.3
* Stable tag: 3.5.15
* Requires PHP: 5.6
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
Stable tag: 3.6.0
Requires at least: 4.1
Tested up to: 6.5
Requires PHP: 5.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: authors, users, multiple authors, co-authors, multi-author, publishing
Contributors: batmoo, danielbachhuber, automattic, GaryJ

Assign multiple bylines to posts, pages, and custom post types with a search-as-you-type input box.

## Usage
## Description

Assign multiple bylines to posts, pages, and custom post types via a search-as-you-type input box. Co-authored posts appear on a co-author's archive page and in their feed. Co-authors may edit the posts they are associated with, and co-authors who are contributors may only edit posts if they have not been published (as is core behavior).

Add writers as bylines without creating WordPress user accounts. Simply [create a guest author profile](https://github.com/Automattic/Co-Authors-Plus/wiki/Creating-and-editing-guest-authors) for the writer and assign the byline as you normally would.

On the frontend, use the [Co-Authors Plus template tags](https://github.com/Automattic/Co-Authors-Plus/wiki/Template-tags) to list co-authors anywhere you'd normally list the author.

This plugin is an almost complete rewrite of the [Co-Authors](https://wordpress.org/plugins/co-authors/) plugin originally developed by Weston Ruter (2007). The original plugin was inspired by the '[Multiple Authors](https://txfx.net/2005/08/16/new-plugin-multiple-authors/)' plugin by Mark Jaquith (2005).

Refer to our [wiki](https://github.com/Automattic/Co-Authors-Plus/wiki) for detailed documentation.

Expand All @@ -28,6 +36,119 @@ Refer to our [wiki](https://github.com/Automattic/Co-Authors-Plus/wiki) for deta
1. Multiple authors can be added to a Post, Page, or Custom Post Type using an auto-complete interface.
2. Guest authors allow you to assign bylines without creating WordPress user accounts. You can also override existing WordPress account meta by mapping a guest author to a WordPress user.

## Frequently Asked Questions

### How do I add Co-Authors Plus support to my theme?

If you've just installed Co-Authors Plus, you might notice that the bylines are being added in the backend but aren't appearing on the front end. You'll need to [add the template tags to your theme](https://github.com/Automattic/Co-Authors-Plus/wiki/Template-tags) before the bylines will appear.

### What happens to posts and pages when I delete a user assigned to a post or page as a co-author?

When a user is deleted from WordPress, they will be removed from all posts for which they are co-authors. If you reassign their posts to another user, that user will be the co-author instead.

### Can I use Co-Authors Plus with WordPress multisite?

Yes! Co-Authors Plus can be activated on a site-by-site basis or network-activated. If you create guest authors, however, those guest authors will exist on a site-by-site basis.

### Who needs permission to do what?

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.

### Can I easily create a list of all co-authors?

Yes! A template tag called `coauthors_wp_list_authors()` accepts many of the same arguments as `wp_list_authors()`. Look in `template-tags.php` for more details.

### Can I disable Guest Authors?

Yes! Guest authors can be disabled entirely through a filter. Having the following line load on `init` will do the trick:
`add_filter( 'coauthors_guest_authors_enabled', '__return_false' )`

## Change Log

[View the change log](https://github.com/Automattic/Co-Authors-Plus/blob/master/CHANGELOG.md).

## 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](https://developer.wordpress.org/reference/hooks/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`.
1 change: 1 addition & 0 deletions build/blocks-store/index.asset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array('wp-data', 'wp-hooks'), 'version' => '82f1cda3f1d3fbb0136c');
1 change: 1 addition & 0 deletions build/blocks-store/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions build/blocks/block-coauthor-avatar/block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "co-authors-plus/avatar",
"version": "1.0.0",
"title": "Co-Author Avatar",
"category": "theme",
"description": "Displays a small scale version of a co-author's avatar. Utilizes fallbacks from Gravatar so everyone has an avatar.",
"keywords": [
"coauthors"
],
"supports": {
"html": false,
"__experimentalBorder": {
"color": true,
"radius": true,
"width": true,
"__experimentalSelector": "img, .block-editor-media-placeholder",
"__experimentalSkipSerialization": true,
"__experimentalDefaultControls": {
"color": false,
"radius": false,
"width": false
}
},
"spacing": {
"margin": true,
"padding": true,
"__experimentalDefaultControls": {
"margin": false,
"padding": false
}
}
},
"usesContext": [
"co-authors-plus/author",
"co-authors-plus/layout"
],
"attributes": {
"size": {
"type": "number",
"default": 24
},
"isLink": {
"type": "boolean",
"default": false
},
"rel": {
"type": "string"
},
"verticalAlign": {
"type": "string"
},
"align": {
"type": "string"
}
},
"textdomain": "co-authors-plus",
"editorScript": "file:./index.js",
"style": "file:./style-index.css"
}
1 change: 1 addition & 0 deletions build/blocks/block-coauthor-avatar/index.asset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'b6b841ac8f86f7358245');
Loading

0 comments on commit 2f124f4

Please sign in to comment.