Skip to content

Refactor security policies and disable block editor notes - #26

Merged
dannorthern merged 3 commits into
mainfrom
dev
May 25, 2026
Merged

Refactor security policies and disable block editor notes#26
dannorthern merged 3 commits into
mainfrom
dev

Conversation

@dannorthern

Copy link
Copy Markdown
Member

This pull request enhances the way comment-related features are disabled, especially focusing on block editor notes and REST API requests, and improves the login error handling logic. The most important changes are grouped below:

Comment and Editor Notes Disabling Improvements:

  • Added logic to strip block editor notes from post type registration arguments and to remove editor notes support from post types, preventing the block editor from making /wp/v2/comments?type=note REST API requests when comments are disabled. This addresses issues with the collaboration sidebar and ensures no REST conflicts. (inc/Comments/Actions.php, README.md) [1] [2] [3] [4]
  • Updated the initialization flow to ensure comment and editor notes disabling logic runs late enough to catch all post types, including those registered after priority 0. (inc/Comments/Actions.php)

Login Error Handling Improvements:

  • Improved the logic for preventing username-based logins: now core is allowed to handle empty credentials, and only non-email usernames are blocked with a clear error message. (inc/Security/Login.php)
  • Updated the generic login error method to only override errors when there is an actual error message, preventing unnecessary overrides. (inc/Security/Login.php)

Strip editor.notes post-type support late on init and at registration so
the post editor does not request /wp/v2/comments?type=note after wp-baseline
unregisters the comments REST routes.
Add UserRegistrationPolicy and wire into Security init for WaaS tenants.
This class contained a hard dependency on Polaris\API, which has no
place in a standalone baseline package. Moved to Polaris\ManagedSite
where it belongs.
@dannorthern
dannorthern merged commit 9afdd69 into main May 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant