Skip to content

Commit

Permalink
Merge pull request #1653 from westonruter/fix/skip-focus-link-fix-amp
Browse files Browse the repository at this point in the history
Varia: Skip skip-link-focus-fix in AMP
  • Loading branch information
michaeldcain authored Dec 30, 2019
2 parents 820ab60 + 8fee691 commit 4362cb4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions varia/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ function varia_scripts() {
* @link https://git.io/vWdr2
*/
function varia_skip_link_focus_fix() {
// Prevent outputting skip-link-focus-fix in AMP since the AMP framework has it built-in,
// per <https://github.com/ampproject/amphtml/issues/18671>.
if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
return;
}

// The following is minified via `terser --compress --mangle -- js/skip-link-focus-fix.js`.
?>
<script>
Expand Down

0 comments on commit 4362cb4

Please sign in to comment.