Repository navigation
Hide role-restricted blocks, widgets and menu items from unpaid users - #559
Merged
Merged
Conversation
Menu item role visibility now uses wpum_get_user_access_roles(), as the shortcode and Elementor restrictions do, so the Stripe integration can withhold roles while a payment is outstanding. Tests cover menu items, blocks and legacy widgets; the block and widget checks live in wpum-blocks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A user who registered on a paid Stripe form and never paid could see blocks, legacy widgets and menu items restricted to their role. The Stripe integration withholds an unpaid account's roles through
wpum_get_user_access_roles(), and the shortcode and Elementor restrictions use it, but these three checks read$user->rolesdirectly.Changes
wpum_get_user_access_roles()(includes/admin/class-wpum-menus.php).1.16.composer.jsonandcomposer.locknow require1.16.Tests
In
tests/wpunit/Stripe/UnpaidCapabilitiesTest.php:test_unpaid_user_does_not_see_role_restricted_block: hidden for an unpaid subscriber, shown once paid, hidden for another role.test_unpaid_user_does_not_see_role_restricted_widget: hidden while unpaid, shown once paid.test_unpaid_user_does_not_see_role_restricted_menu_item: hidden while unpaid, shown once paid.Reported by elba.code via Patchstack.
🤖 Generated with Claude Code