-
Notifications
You must be signed in to change notification settings - Fork 384
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
Add skip link for Full Site Editing themes #6823
Conversation
Plugin builds for 03f03d8 are ready 🛎️!
|
Codecov Report
@@ Coverage Diff @@
## develop #6823 +/- ##
=============================================
+ Coverage 78.31% 78.33% +0.02%
- Complexity 6708 6713 +5
=============================================
Files 202 202
Lines 20210 20236 +26
=============================================
+ Hits 15827 15852 +25
- Misses 4383 4384 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…skip-link * 'develop' of github.com:ampproject/amp-wp: (43 commits) Ensure Navigation block script is registered to fix tests Add missing test coverage for dequeue_block_navigation_view_script Use function exists check for render_block_core_navigation to determine if test should be skipped Add attribute value escaping for good measure Fix phpcs warnings Fix indentation Add assertions that no SQL queries run when data deletion is disabled Add test specifically for transient deletion Harden term deletion logic for WP<4.4 Add assertions for term deletion Flesh out tests specifically for post and term deletion Add test specific to delete_user_metadata Add test specifically for the delete_options function Remove deletion of non-option Add test assertions for terms table Use constant for taxonomy slug in test Add formatting for SQL statements Normalize config.allow-plugins in composer.json Update database queries to delete data during uninstalltion Revert changes from delete_user_metadata() ...
return; | ||
} | ||
|
||
$skip_link_target = $this->dom->getElementId( $main_tag, 'wp--skip-link--target' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good use of getElementId
.
Why the extra hyphens? Why not just:
$skip_link_target = $this->dom->getElementId( $main_tag, 'wp--skip-link--target' ); | |
$skip_link_target = $this->dom->getElementId( $main_tag, 'wp-skip-link-target' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the double hyphens are here to match the JS implementation you'll find in Gutenberg:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That being said, I just noticed that AMP adds a suffix to the skip link ID attribute (e.g. wp--skip-link--target-0
). So it seems that the ID attributes won't be the same on AMP and on non-AMP versions. I guess it doesn't matter in any way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested it on my local - everything is working as expected, the skip links are added on AMP pages just like on the non-AMP pages.
Summary
Fixes #6115
This PR adds a skip link for full site editing themes without causing AMP compatibility issues. The PR uses the similar approach implemented in WordPress/gutenberg#30336 but in PHP.
Checklist