Skip to content

?: to check for empty mm_brand option #331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 13, 2025
Merged

Conversation

BrianHenryIE
Copy link
Contributor

Proposed changes

Three sites somehow had their mm_brand option in the database set to an empty string, resulting inget_option( 'mm_brand', 'bluehost' ) returning ''. This PR changes that to get_option( 'mm_brand') ?: 'bluehost' which returns 'bluehost'.

$ wp shell
wp> delete_option( 'mm_brand' );
=> bool(false)
wp> get_option( 'mm_brand', 'bluehost' )
=> string(8) "bluehost"
wp> get_option( 'mm_brand' ) ?: 'bluehost'
=> string(8) "bluehost"
wp> update_option( 'mm_brand', '' );
=> bool(true)
wp> get_option( 'mm_brand', 'bluehost' )
=> string(0) ""
wp> get_option( 'mm_brand' ) ?: 'bluehost'
=> string(8) "bluehost"

Type of Change

Production

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update
  • Refactoring / housekeeping (changes to files not directly related to functionality)

Development

  • Tests
  • Dependency update
  • Environment update / refactoring
  • Documentation Update

Video

Checklist

  • I have read the CONTRIBUTING doc
  • I have viewed my change in a web-browser
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@BrianHenryIE BrianHenryIE requested a review from circlecube June 11, 2025 22:43
@circlecube circlecube added this to the June 18, 2025 Release milestone Jun 12, 2025
@circlecube circlecube changed the base branch from main to develop June 13, 2025 15:03
@circlecube circlecube merged commit 1a3ed95 into develop Jun 13, 2025
9 of 23 checks passed
@circlecube circlecube deleted the stop-using-mmbrand-option branch June 13, 2025 15:46
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