Yoda conditions

This commit is contained in:
Gary Kealy 2019-07-18 16:48:04 +01:00
parent c2a06502b7
commit bc3c4cb375
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"/>