Skip to content

12. Hand a host the policy list its settings control has to offer - #73

Open
nikolaystrikhar wants to merge 1 commit into
47-lifecycle-actionsfrom
60-policies-a-host-can-list
Open

12. Hand a host the policy list its settings control has to offer#73
nikolaystrikhar wants to merge 1 commit into
47-lifecycle-actionsfrom
60-policies-a-host-can-list

Conversation

@nikolaystrikhar

Copy link
Copy Markdown
Contributor

What: Conflict_Policy::all() becomes public API, so a host's settings control can list every policy instead of hardcoding the three constants.

Usage:

foreach ( Conflict_Policy::all() as $policy ) {
    printf(
        '<option value="%s"%s>%s</option>',
        esc_attr( $policy ),
        selected( $policy, get_option( 'give_absorption_stage' ), false ),
        esc_html( $labels[ $policy ] ?? $policy )
    );
}

Why this way:

Our own recipe asked for a list we kept private. Staged absorption tells hosts to move the policy behind an option; the screen that writes it had to spell the three constants out, and a fourth policy would miss every such screen silently.

Bare strings, no labels. This library has no opinion on toggle UI, and a label produced here would be in the wrong textdomain — the host words its own, keyed off the strings we hand it.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Enterprise

Run ID: eddc4c7e-54a8-40be-8a06-1a4d619e57a3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

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