You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or 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
This PR updates the behavior of the Featured Image block inspector to conditionally display link-related controls based on whether the block is inside a Query Loop or not.
Why?
Prevents unnecessary link-related controls from appearing when they are not applicable.
Ensures that link controls are only available when they can be safely used without causing accessibility or usability issues.
Improves the overall user experience by keeping the block settings relevant to the context.
How?
If not inside a Query Loop and the featured image is not set, the link-related controls will not be rendered in the inspector.
If inside a Query Loop, the link-related controls will always be rendered, as they do not introduce any interactive buttons within an tag, ensuring safe usage.
It also introduces reset functionality to featured image and if its removed then it resets the attributes for link control.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.
If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
…ment (WordPress#69730)
* Feat: removed the code from WordPress#69716 and fixed html structure, added checks for link to be shown only if featured image is set.
* Fix: Update conditions for displaying link options in Post Featured Image edit panel
* Refactor: Add conditional rendering to inspector controls
* feat: add templates for single page templates
Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>
* feat: add sizeSlug prop to reset handler
---------
Co-authored-by: Mayank-Tripathi32 <mayanktripathi32@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
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.
Attempts fix for #69728
What?
This PR updates the behavior of the Featured Image block inspector to conditionally display link-related controls based on whether the block is inside a Query Loop or not.
Why?
How?
ScreenCast
https://q7utzrengv.ufs.sh/f/Wgl9eBAmTj29CAEDuMerV9jUpFsYux6DJmaP53zkqdRfyBQC