Skip to content

Commit

Permalink
Merge pull request understrap#1153 from IanDelMar/deprecate-tag
Browse files Browse the repository at this point in the history
Deprecate understrap_adjust_body_class()
  • Loading branch information
UnderstrapFramework authored Oct 15, 2020
2 parents 62c1f17 + e88dc0e commit 894bdc0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 21 deletions.
22 changes: 22 additions & 0 deletions inc/deprecated.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,28 @@
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;

if ( ! function_exists( 'understrap_adjust_body_class' ) ) {
/**
* Setup body classes.
*
* @param string $classes CSS classes.
*
* @deprecated 0.9.4 Styling of tag has been removed in Bootstrap v4 Alpha 6.
* @link https://github.com/twbs/bootstrap/issues/20939
*/
function understrap_adjust_body_class( $classes ) {

foreach ( $classes as $key => $value ) {
if ( 'tag' == $value ) {
unset( $classes[ $key ] );
}
}

return $classes;

}
}

if ( ! function_exists( 'understrap_slbd_count_widgets' ) ) {
/**
* Count number of widgets in a sidebar
Expand Down
26 changes: 5 additions & 21 deletions inc/extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,12 @@ function understrap_body_classes( $classes ) {
}
}

// Removes tag class from the body_class array to avoid Bootstrap markup styling issues.
add_filter( 'body_class', 'understrap_adjust_body_class' );

if ( ! function_exists( 'understrap_adjust_body_class' ) ) {
/**
* Setup body classes.
*
* @param string $classes CSS classes.
*
* @return mixed
if ( function_exists( 'understrap_adjust_body_class' ) ) {
/*
* understrap_adjust_body_class() deprecated in v0.9.4. We keep adding the
* filter for child themes which use their own understrap_adjust_body_class.
*/
function understrap_adjust_body_class( $classes ) {

foreach ( $classes as $key => $value ) {
if ( 'tag' === $value ) {
unset( $classes[ $key ] );
}
}

return $classes;

}
add_filter( 'body_class', 'understrap_adjust_body_class' );
}

// Filter custom logo with correct classes.
Expand Down

0 comments on commit 894bdc0

Please sign in to comment.