Merge pull request #1009 from ylkyrg/yoda-conditions

Yoda conditions
This commit is contained in:
UnderstrapFramework 2019-12-13 11:57:53 +00:00 committed by GitHub
commit 2f752095a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 3 deletions

View File

@ -189,7 +189,7 @@ if ( ! class_exists( 'Understrap_WP_Bootstrap_Navwalker' ) ) {
}
// If item has_children add atts to <a>.
if ( isset( $args->has_children ) && $args->has_children && 0 === $depth && $args->depth !== 1 ) {
if ( isset( $args->has_children ) && $args->has_children && 0 === $depth && 1 !== $args->depth ) {
$atts['href'] = '#';
$atts['data-toggle'] = 'dropdown';
$atts['aria-haspopup'] = 'true';

View File

@ -27,7 +27,7 @@ if ( ! function_exists( 'understrap_slbd_count_widgets' ) ) {
if ( isset( $sidebars_widgets_count[ $sidebar_id ] ) ) :
$widget_count = count( $sidebars_widgets_count[ $sidebar_id ] );
$widget_classes = 'widget-count-' . count( $sidebars_widgets_count[ $sidebar_id ] );
if ( $widget_count % 4 == 0 || $widget_count > 6 ) :
if ( 0 == $widget_count % 4 || $widget_count > 6 ) :
// Four widgets per row if there are exactly four or more than six
$widget_classes .= ' col-md-3';
elseif ( 6 == $widget_count ) :

View File

@ -26,7 +26,6 @@
<!-- Use the WordPress Ruleset -->
<rule ref="WordPress">
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<exclude name="WordPress.PHP.YodaConditions.NotYoda"/>
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd"/>
<exclude name="WordPress.WhiteSpace.DisallowInlineTabs.NonIndentTabsUsed"/>
<exclude name="WordPress.Security.EscapeOutput.UnsafePrintingFunction"/>