This commit is contained in:
Alexander Agnarson 2019-07-26 19:59:15 +02:00
parent 0a3410136a
commit 8041776597
6 changed files with 64 additions and 31 deletions

View file

@ -678,18 +678,6 @@ if ( ! function_exists( 'boxstyle_html_js_class' ) ) {
add_action( 'wp_head', 'boxstyle_html_js_class', 1 );
/* Script for no-js / js class
/* ------------------------------------ */
if ( ! function_exists( 'boxstyle_html_js_class' ) ) {
function boxstyle_html_js_class () {
echo '<script>document.documentElement.className = document.documentElement.className.replace("no-js","js");</script>'. "\n";
}
}
add_action( 'wp_head', 'boxstyle_html_js_class', 1 );
/* Admin panel css
/* ------------------------------------ */
if ( ! function_exists( 'boxstyle_admin_panel_css' ) ) {
@ -731,10 +719,6 @@ if ( ! function_exists( 'boxstyle_plugins' ) ) {
array(
'name' => esc_html__( 'WP-PageNavi', 'boxstyle' ),
'slug' => 'wp-pagenavi',
),
array(
'name' => esc_html__( 'Responsive Lightbox', 'boxstyle' ),
'slug' => 'responsive-lightbox',
)
);
tgmpa( $plugins );
@ -852,3 +836,14 @@ if ( ! function_exists( 'boxstyle_flexslider_gallery' ) ) {
}
add_action( 'wp_enqueue_scripts', 'boxstyle_flexslider_gallery' );
/* Accessibility IE11 fix - https://git.io/vWdr2
/* ------------------------------------ */
function boxstyle_skip_link_focus_fix() {
?>
<script>
/(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())},!1);
</script>
<?php
}
add_action( 'wp_print_footer_scripts', 'boxstyle_skip_link_focus_fix' );