Skip to content

Prevent stale profile role from undoing linked tag role changes. - #2

Merged
sorinmarta merged 1 commit into
masterfrom
fix-profile-role-overwrite-from-linked-tags
Jun 18, 2026
Merged

Prevent stale profile role from undoing linked tag role changes.#2
sorinmarta merged 1 commit into
masterfrom
fix-profile-role-overwrite-from-linked-tags

Conversation

@sorinmarta

Copy link
Copy Markdown
Contributor

When tags are edited on the user profile screen, WordPress was still saving the posted role and reverting the role set by linked tags.

When tags are edited on the user profile screen, WordPress was still saving the posted role and reverting the role set by linked tags.
Copilot AI review requested due to automatic review settings June 18, 2026 07:30

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.

Pull request overview

Prevents a user’s role from being unintentionally reverted when editing tags on the WordPress user profile screen, by ensuring the stale posted role value doesn’t overwrite role changes triggered by linked tags.

Changes:

  • After adding/removing a role in tags_modified(), clears the posted role value during profile updates to avoid WordPress re-saving it.
  • Introduces a small private helper (prevent_profile_role_overwrite()) to encapsulate the profile-update detection and $_POST['role'] unsetting logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread includes/class-wp-fusion-user-roles-public.php
@sorinmarta
sorinmarta merged commit b768a81 into master Jun 18, 2026
1 check passed
@sorinmarta
sorinmarta deleted the fix-profile-role-overwrite-from-linked-tags branch June 18, 2026 07:48
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