Skip to content

Add feature-flag system over framework FeatureSelector#714

Open
Adi-ty wants to merge 1 commit into
theme-elementary-v2from
feat/feature-selector-integration
Open

Add feature-flag system over framework FeatureSelector#714
Adi-ty wants to merge 1 commit into
theme-elementary-v2from
feat/feature-selector-integration

Conversation

@Adi-ty

@Adi-ty Adi-ty commented Jun 12, 2026

Copy link
Copy Markdown

Description

Integrate rtCamp/wp-framework FeatureSelector as a feature-flag system, gating experimental modules behind opt-in toggles.

Technical Details

  • New inc/Core/Features.php — extends framework FeatureSelector implements Shareable with elementary context; registers two flags: author-bio and media-text-interactive.
  • New inc/Modules/Settings/FeaturesSettingsPage.php — extends framework FeatureSelectorSettingsPage with theme-specific titles.
  • inc/Modules/Shortcodes/AuthorBio.php — changed from Registrable to ConditionallyRegistrable, gated behind Features::AUTHOR_BIO.
  • inc/Modules/BlockExtensions/MediaTextInteractive.php — changed to ConditionallyRegistrable, gated behind Features::MEDIA_TEXT_INTERACTIVE.
  • inc/Helpers/Util.php — added is_feature_enabled() hook-time accessor.
  • inc/Main.phpFeatures::class and FeaturesSettingsPage::class added to CLASSES.
  • composer.json — framework pinned to dev-feature/feature-selector-utility.
  • Full test coverage: 5 new test files, 45 tests, 99 assertions, all passing.

Checklist

  • FeatureSelector integration with two flags (author-bio, media-text-interactive)
  • Settings page at Settings → Features with per-flag checkboxes
  • Constant-override support with locked checkbox UI
  • ConditionallyRegistrable gating for AuthorBio shortcode
  • ConditionallyRegistrable gating for MediaTextInteractive block extension
  • Util::is_feature_enabled() helper for hook-time consumers
  • Tests for all wiring, key derivation, flag lifecycle, instance parity
  • PHPCS clean, all tests green

Screenshots

Screenshot 2026-06-13 at 1 59 06 AM

Fixes/Covers issue

Part of https://github.com/rtCamp/wp-framework/issues/7

- Features class (Shareable) registers author-bio & media-text-interactive flags
- FeaturesSettingsPage renders checkbox UI for each flag
- AuthorBio + MediaTextInteractive changed to ConditionallyRegistrable, gated behind their respective flags
- Framework pinned to dev-feature/feature-selector-utility
@Adi-ty Adi-ty marked this pull request as ready for review June 13, 2026 00:43
@Adi-ty Adi-ty self-assigned this Jun 13, 2026
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