This repository was archived by the owner on Apr 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Add "encode => true" to alt and caption fields #67
Merged
Conversation
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
Since Shortcake added support for URL-encoding attribute values (wp-shortcake/shortcake#496), we can remove the unfriendly admonitions to avoid using quote marks, branckets, or HTML in the alt and caption fields here.
Contributor
Author
|
@danielbachhuber #reviewmerge? |
In order to take advantage of the automagickal decoding that Shortcake gives for free with an encoded field, we have to use `shortcode_atts` to extract the attribute values, rather than `wp_parse_args()`. Also, I filed out a missing docblock comment for the filter here.
Contributor
|
@goldenapples build fail-y |
Contributor
|
Looks good otherwise. |
Contributor
Author
|
Ugh. Not as simple as I was thinking. |
Because the `shortcode_atts()` function requires a whitelist of all attributes to allow, its necessary to take all the registered attributes and merge them with a few necessary defaults before passing through that function. `src` and `classes` are not yet exposed in the UI, so they're merged in here.
Contributor
Author
|
Actually, not so tricky at all - fixed in f250552. |
danielbachhuber
added a commit
that referenced
this pull request
Nov 24, 2015
…elds Add "encode => true" to alt and caption fields
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Since Shortcake added support for URL-encoding attribute values (wp-shortcake/shortcake#496), we can remove the unfriendly admonitions to avoid using quote marks, branckets, or HTML in the alt and caption fields here by passing "encode" => true in the attribute registration.
#42