Skip to content

Commit

Permalink
Tweak: Add filter to enable/disable skip link and a filter to change …
Browse files Browse the repository at this point in the history
…skip link URL [ED-10179] (#269)

* Tweak: Add filter to enable/disable skip link and a filter to change skip link URL

* Move viewport_content to the top
  • Loading branch information
rami-elementor authored Mar 20, 2023
1 parent 2934a35 commit 27e3144
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}

$viewport_content = apply_filters( 'hello_elementor_viewport_content', 'width=device-width, initial-scale=1' );
$enable_skip_link = apply_filters( 'hello_elementor_enable_skip_link', true );
$skip_link_url = apply_filters( 'hello_elementor_skip_link_url', '#content' );
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<?php $viewport_content = apply_filters( 'hello_elementor_viewport_content', 'width=device-width, initial-scale=1' ); ?>
<meta name="viewport" content="<?php echo esc_attr( $viewport_content ); ?>">
<link rel="profile" href="https://gmpg.org/xfn/11">
<?php wp_head(); ?>
Expand All @@ -24,8 +27,9 @@

<?php wp_body_open(); ?>

<a class="skip-link screen-reader-text" href="#content">
<?php echo esc_html__( 'Skip to content', 'hello-elementor' ); ?></a>
<?php if ( $enable_skip_link ) { ?>
<a class="skip-link screen-reader-text" href="<?php esc_url( $skip_link_url ); ?>"><?php echo esc_html__( 'Skip to content', 'hello-elementor' ); ?></a>
<?php } ?>

<?php
if ( ! function_exists( 'elementor_theme_do_location' ) || ! elementor_theme_do_location( 'header' ) ) {
Expand Down

0 comments on commit 27e3144

Please sign in to comment.