Skip to content

Capabilities: Define the legacy edit_page alias for activity posts. - #63

Merged
JJJ merged 2 commits into
masterfrom
fix/activity-edit-page-capability
Oct 6, 2026
Merged

JJJ merged 2 commits into
masterfrom
fix/activity-edit-page-capability

Conversation

@JJJ

@JJJ JJJ commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Define the legacy edit_page capability for activity posts and map it to the existing list_users permission. This prevents WordPress from reading an undefined capability property when an activity post is checked through edit_page.

Add a focused unit regression for the post type capability registration. The change addresses the warning reported in the WordPress.org support topic.

Validation

  • Reproduced Undefined property: stdClass::$edit_page in a real WordPress test site with the mapping removed for one request; the same check returned list_users without a warning with the mapping present.
  • composer test, PHPCS baseline, PHPStan, PHP syntax checks, and the existing multisite integration smoke test passed locally.
  • Both commits are signed and GitHub reports their signatures as Verified.

JJJ added 2 commits October 5, 2026 19:43
WordPress can check edit_page against an activity post. Map that alias to list_users so the capability lookup does not emit an undefined-property warning while preserving the existing activity-edit permission.

Cover the registration and WordPress capability mapping with unit and multisite integration assertions.
The integration smoke file is pinned by central policy. Keep the capability regression in the unit suite and leave the smoke file unchanged in this plugin pull request.
@JJJ
JJJ requested a balanced review from Copilot October 6, 2026 00:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The capability mapping is correct, compatible, and covered by a focused regression test.

Review effort: Balanced
Findings: None

What changed in this PR

Defines the legacy edit_page capability to prevent undefined-property warnings during activity post checks.

Changes:

  • Maps edit_page to list_users.
  • Adds a focused regression test.
File Description
wp-user-activity/​includes/​post-types.php Registers the legacy capability alias.
tests/​PostTypeTest.php Verifies the capability mapping.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@JJJ
JJJ marked this pull request as ready for review October 6, 2026 00:49
@JJJ
JJJ merged commit 05d45dc into master Oct 6, 2026
13 checks passed
@JJJ
JJJ deleted the fix/activity-edit-page-capability branch October 6, 2026 00:50
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.

2 participants