Skip to content

Use public function get_option_name instead of static value - #668

Merged
daggerhart merged 2 commits into
oidc-wp:developfrom
michaelwood:fix/use_get_option_name
Nov 17, 2026
Merged

daggerhart merged 2 commits into
oidc-wp:developfrom
michaelwood:fix/use_get_option_name

Conversation

@michaelwood

@michaelwood michaelwood commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor

As get_option_name is public any child classes may implement get_option_name however currently this will not do what is intended due to accessing the property directly in the parent functions.

All Submissions:

Changes proposed in this Pull Request:

Closes #667 .

How to test the changes in this Pull Request:

  1. subclass the classes
  2. Implement a get_option_name function that returns a new string
  3. See that a new OPTION_NAME is stored / logged

The existing tests should provide necessary coverage here to avoid any regression.

Changelog entry

Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.

Fix:

  • Use get_option_name in class functions instead of self::OPTION_NAME to ensure the correct value is used if subclassed.

As get_option_name is public any child classes may implement
get_option_name however currently this will not do what is intended due
to accessing the property directly in the parent functions.

Fixes: oidc-wp#667
@daggerhart
daggerhart merged commit 7758fe8 into oidc-wp:develop Nov 17, 2026
9 checks passed
@daggerhart

Copy link
Copy Markdown
Collaborator

Thanks for the help!

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.

Use existing get_option_name functions in logger and settings for subclassing

2 participants