Skip to content
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

Add understrap_is_bootstrap_v4() to simplify version checking #2201

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

IanDelMar
Copy link
Contributor

Description

  • Addition of understrap_is_bootstrap_v4(): This new function simplifies the process of checking the Bootstrap version utilized by the theme. Instead of directly comparing the theme mod value with 'bootstrap4', developers can now use this concise and readable function, enhancing code maintainability and readability.
  • Fix for $label_class in WooCommerce template: I've addressed an issue in the woocommerce/checkout/form-verify-email.php template where $label_class was incorrectly set to an empty string due to the always truthy evaluation of get_theme_mod( 'understrap_bootstrap_version', 'bootstrap4' ). This fix ensures that $label_class is accurately assigned, improving the visual consistency of the checkout form.

Motivation and Context

  • Simplification and Readability: By encapsulating the Bootstrap version check within a dedicated function, we make the codebase more intuitive and easier to manage.
  • Bug Fix and Consistency: Correcting the $label_class assignment ensures that the WooCommerce form remains visually consistent, enhancing the user experience.

Types of changes

  • Bug fix (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 change)
  • Refactoring (a code change that neither fixes a bug nor adds a feature)
  • Styling (changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc))
  • Development (changes that affect the build system or external dependencies)
  • Documentation (changes that affect existing inline documentation)

Checklist:

  • I pulled my branch from develop.
  • I am submitting my pull request to develop.
  • I have resolved any conflicts merging this pull request would create.
  • I have checked that there aren't other open Pull Requests for the same update/change.
  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • (Optional) My change requires a change to the documentation.
  • (Optional) I have updated the documentation accordingly.
  • (Optional) My change requires a change to the translations.
  • (Optional) I have updated the translations accordingly.
  • composer phpcs has passed locally.
  • composer php-lint has passed locally.
  • composer phpmd has passed locally.
  • composer phpstan has passed locally.
  • I have read the CONTRIBUTING document.

Related Issues or Roadmap requests

Further comments

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.

None yet

1 participant