Tweak targetSchema Response#6613
Merged
danielbachhuber merged 1 commit into6361-post-stickyfrom May 7, 2018
Merged
Conversation
4 tasks
danielbachhuber
approved these changes
May 7, 2018
danielbachhuber
added a commit
that referenced
this pull request
May 7, 2018
…6529) * Use `targetSchema` of JSON Hyper Schema to communicate sticky action Because WordPress' capabilities system is filterable, we need to execute the capabilities before we know whether the current user can perform the action. Fortunately, `targetSchema` supports exactly this use-case. * Ensure links are properly formatted * Avoid re-renders when the current post changes * Technically more correct test * Update tests for 3e591c5 * Only include `wp:action-sticky` for `context=edit`; move description * Move the description text from the targetSchema to the link title. (#6613)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This is a PR against #6529.
It tweaks the response for the
wp:action-stickylink, to more clearly state what it's used for:descriptionoutside of thetargetSchemaobject, towp:action-sticky'stitleattribute. This makes it clear that the text is referring to the link, not thetargetSchema.wp:action-stickylink: ifwp:action-stickyis present, then the current user has the ability to make the post sticky.