-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 link to options-general.php
in the site title description
#31122
Open
vdwijngaert
wants to merge
4
commits into
WordPress:trunk
Choose a base branch
from
vdwijngaert:add/site-title-link-to-settings-page
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a564edd
Add link to `options-general.php` in the site title description
vdwijngaert 7a37d0e
Open link in same window.
vdwijngaert 893063d
Add accessible component for describing steps
vdwijngaert c9ba600
Site title: use AccessibleSteps for settings link.
vdwijngaert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
packages/block-library/src/site-title/util/accessible-steps.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __ } from '@wordpress/i18n'; | ||
|
||
/** | ||
* External dependencies | ||
*/ | ||
import { isEmpty } from 'lodash'; | ||
|
||
const PathSeparator = () => ( | ||
<> | ||
| ||
<span | ||
aria-label={ | ||
// translators: accessibility text for describing steps with the > character | ||
__( 'and then' ) | ||
} | ||
> | ||
{ '>' } | ||
</span>{ ' ' } | ||
</> | ||
); | ||
|
||
export default function AccessibleSteps( { elements, link } ) { | ||
if ( isEmpty( elements ) ) { | ||
return null; | ||
} | ||
|
||
const Wrapper = ( { children } ) => | ||
isEmpty( link ) ? <>{ children }</> : <a href={ link }>{ children }</a>; | ||
|
||
return ( | ||
<Wrapper> | ||
<b> | ||
{ elements.reduce( ( acc, curr ) => ( | ||
<> | ||
{ acc } | ||
<PathSeparator /> | ||
{ curr } | ||
</> | ||
) ) } | ||
</b> | ||
</Wrapper> | ||
); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We'll want to avoid a hardcoded link here since some clients need to be able to override this link. Other places have used a slot/fill pattern, but we may need a new generic filter for links added in block settings.
Added a screencap of feedback to save folks a click, from #30926
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.
Thanks for sharing! So we need a way for clients to be able to override internal links. Maybe something for a
[Type] Discussion
issue?How do you suggest we go from here?
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.
For next steps maybe something like:
If you're interested in the general problem, I think we can reuse this PR and update the summary + title. If not, I was intending to follow up on this, and I'd be happy to ping folks when a mechanism is available. Just let me know :D