Skip to content
This repository was archived by the owner on Apr 2, 2020. It is now read-only.

Conversation

@goldenapples
Copy link
Contributor

When selecting a new attachment for an [img] shortcode, the alt and caption attributes should be inherited from the attachment post.

See #12.

Depends on wp-shortcake/shortcake#358.

When selecting a new attachment for an [img] shortcode, the alt and
caption attributes should be inherited from the attachment post.
@goldenapples
Copy link
Contributor Author

This is a first stab at using the hooks in editAttributeFieldAttachment I'm working on in wp-shortcake/shortcake#358. Its possible to listen to updates on that field, and use the data for purposes like this.

The code here looks a little too complicated for my tastes, so I think introducing some helper methods in Shortcake to do basic functions like find a field in a collection, or get / set the value of an attribute, are called for.

@danielbachhuber
Copy link
Contributor

The code here looks a little too complicated for my tastes, so I think introducing some helper methods in Shortcake to do basic functions like find a field in a collection, or get / set the value of an attribute, are called for.

👍

Updated these listener actions to use a couple of new helper methods in
Shortcake, `editAttributeFieldAttachment.getFromCache()` to retrieve
cached attachment data, and editAttributeField.getField()` to find a
field in a collection.
@davisshaver davisshaver modified the milestones: Image Audit, next Jul 14, 2015
@danielbachhuber danielbachhuber modified the milestones: next, Image Audit Jul 14, 2015
@davisshaver
Copy link
Member

@goldenapples Know you're in the 🚗 now, but just noting that after working on this and https://github.com/fusioneng/fusion-theme/issues/3681 I think they are both good for a review/merge.

goldenapples added a commit that referenced this pull request Aug 4, 2015
…ment

Set alt and caption fields on selecting attachment
@goldenapples goldenapples merged commit 7a8fb91 into master Aug 4, 2015
@goldenapples goldenapples deleted the 12-inherit-defaults-from-attachment branch August 4, 2015 02:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants