Displays the guest author's profile URL as retrieved from the WP REST API.
Removes the ability to delete a guest author via the REST API ( this would not trigger necessary clean up, use /wp-admin/users.php?page=view-guest-authors instead.
Added CSS to the block editor that hides the "Switch to draft" button.
Guest Authors should either be publish or non-existent.
Added functions that provide URL and file path information needed to enqueue assets.
Added the filter cata_cap_use_block_editor so themes / sites can opted into using the block editor for guest authors.
Added the PHP class Cata\CoAuthors_Plus\Editor
Adds support for post_content to the guest-author post type
Redirects /wp-admin/edit.php?post_type=guest-author to the custom CoAuthors Plus user list page.
Added the PHP class Cata\CoAuthors_Plus\Editor\Classic
Removes support for post_content just in time so the classic editor can work normally
Added the PHP class Cata\CoAuthors_Plus\Editor\Block
Adds support for the block editor based on post type and status.
Adds JS and CSS assets only when editing a guest-author
Moves nonce field necessary for saving metabox fields.
Updates author taxonomy to be public_queryable so it can be used as a filter in the query loop block
Added functions a theme can use in a template to understand if an author has post_content in their guest author profile.
How It Was Tested
[x] Local plugin dev site
[x] Local theme dev site
[x] Remote theme dev site
How To Test
Available for testing using the tagged version 0.6.0-beta5
Default State
[x] Without opting into block editor support, editing guest authors functions normally in the classic editor.
Block Editor Opt In
Add add_action( 'cata_cap_use_block_editor', '__return_true' ); to the theme's functions file
[x] Adding a guest author uses the classic editor
[x] Once saved, you are redirected to the block editor
[x] Updating meta values like First / Last Name works normally and survives reloading the editor.
Ouputting content
[x] Adding the code shown below outside of the loop in an author archive template outputs the post_content.
if ( cata_cap_queried_coauthor_has_post_content() ) {
$query = new WP_Query(
array(
'p' => $author->ID,
'post_type' => 'guest-author',
)
);
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
the_content();
}
}
}
wp_reset_postdata();
Open Questions
If a theme has other filters on use_block_editor_* its possible they will override the plugin's filter on use_block_editor_for_post. The solution so far the solution has been use a lower priority for the theme filters. Should the filter in the plugin be higher?
Addressed by raising the priority to 20
The CataCAPGuestAuthorURL component handles multiple responsibilities, it should be split up.
Addressed by making the profile URL portion its own component.
The package.json file needs more details before merging
Related Issues
What Was Accomplished
@wordpress/scripts
dependencies/wp-admin/users.php?page=view-guest-authors
instead.cata_cap_use_block_editor
so themes / sites can opted into using the block editor for guest authors.Cata\CoAuthors_Plus\Editor
/wp-admin/edit.php?post_type=guest-author
to the custom CoAuthors Plus user list page.Cata\CoAuthors_Plus\Editor\Classic
Cata\CoAuthors_Plus\Editor\Block
author
taxonomy to be public_queryable so it can be used as a filter in the query loop blockHow It Was Tested
How To Test
Available for testing using the tagged version
0.6.0-beta5
Default State
Block Editor Opt In
Add
add_action( 'cata_cap_use_block_editor', '__return_true' );
to the theme's functions fileOuputting content
Open Questions
use_block_editor_*
its possible they will override the plugin's filter onuse_block_editor_for_post
. The solution so far the solution has been use a lower priority for the theme filters. Should the filter in the plugin be higher?CataCAPGuestAuthorURL
component handles multiple responsibilities, it should be split up.