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

Remove deprecated code #734

Merged
merged 23 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
185d473
Remove deprecated js
crftwrk Mar 12, 2024
407b7cb
Delete page-blank-without-container.php
crftwrk Mar 12, 2024
ba37f7b
Delete woocommerce-functions.php
crftwrk Mar 12, 2024
6bfae92
Delete my-account-offcanvas.php
crftwrk Mar 12, 2024
49e6ebf
Rename default logo path filter
crftwrk Mar 12, 2024
14ab91d
Update footer.php
crftwrk Mar 12, 2024
c4aa7d1
Fix nested small in footer
crftwrk Mar 13, 2024
f02b265
Restore Font Awesome shortcode
crftwrk Mar 19, 2024
68b4df2
Restore CSS for classic navigation widgets
crftwrk Mar 19, 2024
26bd3ce
Removed hook bs_after_primary
crftwrk Mar 19, 2024
a3d3bf9
Remove empty IE warning function
crftwrk Mar 19, 2024
2dd840d
Remove snippet to allow shortcode in classic text widget
crftwrk Mar 19, 2024
1f5d803
Removed fallbacks for `bootscore_main_col_class`, `bootscore_sidebar_…
crftwrk Mar 19, 2024
63471b2
Removed fallback for old loop cards <5.2.3.3
crftwrk Mar 19, 2024
a030347
Removed fallback dark-mode for existing `bg-light` classes
crftwrk Mar 19, 2024
a433997
Removed empty `autop`
crftwrk Mar 19, 2024
c2ca901
Removed hide recaptcha badge
crftwrk Mar 19, 2024
f615aec
Restore password protected form
crftwrk Mar 19, 2024
c19e90f
Removed deprecated checkbox filter for `terms.php`
crftwrk Mar 19, 2024
4841f23
Removed hide extsting cart-loader in header.php. Breaking if `<div cl…
crftwrk Mar 19, 2024
1b89220
Removed hide duplicate empty mini-cart message in cart page
crftwrk Mar 19, 2024
aa20680
Fix text class in comments
crftwrk Mar 20, 2024
f005a53
Add unique class to each header button
crftwrk Mar 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions assets/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ jQuery(function ($) {
$('.offcanvas').offcanvas('hide');
});

// Search collapse button hide if empty
// Deprecated v5.2.3.4, done by php if (is_active_sidebar('top-nav-search')) in header.php
// Remove in v6
if ($('#collapse-search').children().length == 0) {
$('.top-nav-search-md, .top-nav-search-lg').remove();
}

// Searchform focus
$('#collapse-search').on('shown.bs.collapse', function () {
$('.top-nav-search input:first-of-type').trigger('focus');
Expand Down
4 changes: 3 additions & 1 deletion assets/scss/_bootscore-style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@
@import "bootscore/breadcrumb";
@import "bootscore/colors";
@import "bootscore/comments";
@import "bootscore/deprecated";
@import "bootscore/footer";
@import "bootscore/forms";
@import "bootscore/header";
@import "bootscore/loop";
@import "bootscore/markups";
@import "bootscore/deprecated";
@import "bootscore/pw-protected-form";
@import "bootscore/single";
@import "bootscore/tables";
@import "bootscore/top-button";
@import "bootscore/utilities";
@import "bootscore/widgets";

@import "bootscore/blocks/block-widgets";
12 changes: 0 additions & 12 deletions assets/scss/bootscore-woocommerce/_wc-deprecated.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,3 @@
WooCommerce Deprecated
--------------------------------------------------------------*/

// Hide duplicate empty mini-cart message in cart page
// Came with one of the last WooCommerce updates
// https://user-images.githubusercontent.com/51531217/227728763-6bef0130-f68a-4148-9c4e-6061b49feaea.png
.woocommerce-notices-wrapper .woocommerce-mini-cart__empty-message {
display: none;
}


// Hide extsting cart-loader in header.php, remove this in v6
#offcanvas-cart .cart-loader {
display: none !important;
}
99 changes: 0 additions & 99 deletions assets/scss/bootscore/_deprecated.scss
Original file line number Diff line number Diff line change
@@ -1,102 +1,3 @@
/*--------------------------------------------------------------
Deprecated
--------------------------------------------------------------*/

// Remove autop (WP 5.7 bug near shortcode)
// https://wordpress.org/support/topic/how-to-stop-wp-from-adding-p-tag-automatically/
p:empty:before {
content: none;
}

// Hide racaptcha v3 badge
.grecaptcha-badge {
display: none !important;
}

// Dark mode (remove when themes and plugins are updated to new dark-mode)
[data-bs-theme="dark"] {

// Fallback for existing bg-light classes
.bg-light {
background-color: var(--#{$prefix}tertiary-bg) !important;
}

// Cookie settings plugin
.desc.b-acc,
#s-bl tr {
border-color: var(--#{$prefix}modal-bg) !important;
}
}

// Hotfix password protected input-group button
// Function creates <br> tags?
.pw_form .btn {
border-top-right-radius: $btn-border-radius !important;
border-bottom-right-radius: $btn-border-radius !important;
}


// Fallback for previous horizontal card images
// See https://github.com/bootscore/bootscore/issues/447
// Remove in v6
// category.php, archive.php, author.php and search results
@include media-breakpoint-down(lg) {
.card-img-left-md img {
border-top-left-radius: $border-radius;
border-top-right-radius: $border-radius;
width: 100%;
height: auto;
}
}

@include media-breakpoint-up(lg) {
.card-img-left-md img {
border-top-left-radius: $border-radius;
border-bottom-left-radius: $border-radius;
object-fit: cover;
width: 100%;
height: 100%;
}
}

// Sticky post in index.php
@include media-breakpoint-down(md) {
.card-img-left img {
border-top-left-radius: $border-radius;
border-top-right-radius: $border-radius;
width: 100%;
height: auto;
}
}

@include media-breakpoint-up(md) {
.card-img-left img {
border-top-left-radius: $border-radius;
border-bottom-left-radius: $border-radius;
object-fit: cover;
width: 100%;
height: 100%;
}
}



// Widgets
// Not needed anymore since Gutenberg blocks
// Reset ul in sidebar and footer widgets
.widget-area ul,
.bootscore-footer ul {
padding: 0;
list-style: none;
margin-bottom: 0;
}

// Reset nested ul in sidebar widgets
.widget-area ul li ul li {
padding: 0 1rem;
}

// Reset padding-left in Footer menu
#footer-menu li a {
padding-left: 0;
}
8 changes: 7 additions & 1 deletion assets/scss/bootscore/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ body {

#content {
flex: 1;
}
}


// Reset padding-left in Footer menu
#footer-menu li a {
padding-left: 0;
}
10 changes: 10 additions & 0 deletions assets/scss/bootscore/_pw-protected-form.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*--------------------------------------------------------------
Password protected form
--------------------------------------------------------------*/

// Hotfix password protected input-group button
// Function creates <br> tags?
.pw_form .btn {
border-top-right-radius: $btn-border-radius !important;
border-bottom-right-radius: $btn-border-radius !important;
}
10 changes: 10 additions & 0 deletions assets/scss/bootscore/_widgets.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*--------------------------------------------------------------
Widgets
--------------------------------------------------------------*/

// Reset classic navigation widgets ul
.widget .menu {
padding: 0;
list-style: none;
margin-bottom: 0;
}
4 changes: 2 additions & 2 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@
</div>
</div>

<div class="<?= apply_filters('bootscore/class/footer_info', 'bg-body-tertiary text-body-secondary border-top py-2 text-center small'); ?> bootscore-info">
<div class="<?= apply_filters('bootscore/class/footer_info', 'bg-body-tertiary text-body-secondary border-top py-2 text-center'); ?> bootscore-info">
<div class="<?= apply_filters('bootscore/class/container', 'container', 'footer-info'); ?>">
<?php if (is_active_sidebar('footer-info')) : ?>
<?php dynamic_sidebar('footer-info'); ?>
<?php endif; ?>
<div class="bootscore-copyright"><span class="cr-symbol">&copy;</span>&nbsp;<?= date('Y'); ?> <?php bloginfo('name'); ?></div>
<div class="small bootscore-copyright"><span class="cr-symbol">&copy;</span>&nbsp;<?= date('Y'); ?> <?php bloginfo('name'); ?></div>
</div>
</div>

Expand Down
1 change: 1 addition & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
require_once('inc/enable-html.php'); // Enable HTML in category and author description
require_once('inc/enqueue.php'); // Enqueue scripts and styles
require_once('inc/excerpt.php'); // Adds excerpt to pages
require_once('inc/fontawesome.php'); // Adds shortcode for inserting Font Awesome icons
require_once('inc/hooks.php'); // Custom hooks
require_once('inc/navwalker.php'); // Register the Bootstrap 5 navwalker
require_once('inc/navmenu.php'); // Register the nav menus
Expand Down
2 changes: 1 addition & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
?>

<!-- Navbar Toggler -->
<button class="<?= apply_filters('bootscore/class/header_button', 'btn btn-outline-secondary', 'menu'); ?> d-lg-none ms-1 ms-md-2" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvas-navbar" aria-controls="offcanvas-navbar">
<button class="<?= apply_filters('bootscore/class/header_button', 'btn btn-outline-secondary', 'menu'); ?> d-lg-none ms-1 ms-md-2 nav-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvas-navbar" aria-controls="offcanvas-navbar">
<i class="fa-solid fa-bars"></i><span class="visually-hidden-focusable">Menu</span>
</button>

Expand Down
4 changes: 2 additions & 2 deletions inc/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Comments
*
* @package Bootscore
* @version 5.3.3
* @version 6.0.0
*/


Expand Down Expand Up @@ -61,7 +61,7 @@ function bootscore_comment($comment, $args, $depth) {
<div class="mt-0"><?php printf(__('%s <span class="says d-none">says:</span>', 'bootscore'), sprintf('<h3 class="h5">%s</h3>', get_comment_author_link())); ?>
</div>

<p class="small comment-meta text-secondary">
<p class="small comment-meta text-body-secondary">
<time datetime="<?php comment_time('c'); ?>">
<?php printf(_x('%1$s at %2$s', '1: date, 2: time', 'bootscore'), get_comment_date(), get_comment_time()); ?>
</time>
Expand Down
77 changes: 0 additions & 77 deletions inc/deprecated.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,80 +11,3 @@
// Exit if accessed directly
defined('ABSPATH') || exit;


// Remove in v6
// Internet Explorer Warning Alert
if (!function_exists('bootscore_ie_alert')) :
/**
* Deprecated - functionality is removed already - Code will be removed in a future release.
* Replaced with a js solution to prevent page caching
*
* (Displays an alert if page is browsed by Internet Explorer)
*
* function stays to not break child themes with the function bootscore_ie_alert() immediately
*/
function bootscore_ie_alert() {
}
endif;


/*
* If we want to publish in WordPress theme repository, we have to delete this because shortcode is plugin area
*
* Simple short code for inserting font awesome icons on Gutenberg leveli
* (instead of heaving to insert HTML code into a block on HTML editing mode)
*/
function bsfaCode($atts) {
$atts = (array) $atts;
$vstr = "";
foreach ($atts as $value) {
$vstr = $vstr . " $value";
}

return '<i class="' . $vstr . '"></i>';
}

;
add_shortcode('bsfa', 'bsfaCode');


/**
* Enable shortcodes in HTML-Widget
* Not needed for Gutenberg widgets https://github.com/bootscore/bootscore/pull/660
*/
add_filter('widget_text', 'do_shortcode');


/*
* Check if the old functions which were used for simple classes are used in the child theme
* If so, we transform them to use the new filter hooks
*/
if (function_exists('bootscore_main_col_class')) {
add_filter('bootscore/class/col/main', 'bootscore_main_col_class', 100);
}

if (function_exists('bootscore_sidebar_col_class')) {
add_filter('bootscore/class/col/sidebar', 'bootscore_sidebar_col_class', 100);
}

if (function_exists('bootscore_sidebar_toggler_class')) {
add_filter('bootscore/sidebar/toggler_class', 'bootscore_sidebar_toggler_class', 100);
}

if (function_exists('bootscore_sidebar_offcanvas_class')) {
add_filter('bootscore_sidebar_offcanvas_class', 'bootscore_sidebar_offcanvas_class', 100);
}

if (function_exists('bootscore_container_class')) {
add_filter('bootscore/class/container', 'bootscore_container_class', 100);
}




/**
* Hook after #primary
*/
function bs_after_primary() {
do_action('bs_after_primary');
}
30 changes: 30 additions & 0 deletions inc/fontawesome.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

/**
* Font Awesome
*
* @package Bootscore
* @version 6.0.0
*/


// Exit if accessed directly
defined('ABSPATH') || exit;


/*
* Simple shortcode for inserting Font Awesome icons on Gutenberg level
* (instead of heaving to insert HTML code into a block on HTML editing mode)
*/
function bsfaCode($atts) {
$atts = (array) $atts;
$vstr = "";
foreach ($atts as $value) {
$vstr = $vstr . " $value";
}

return '<i class="' . $vstr . '"></i>';
}

;
add_shortcode('bsfa', 'bsfaCode');
Loading