Skip to content
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

Dot notation for Post Thumbnail title and Caption #7005

Closed
pd-cm opened this issue Feb 2, 2023 · 2 comments
Closed

Dot notation for Post Thumbnail title and Caption #7005

pd-cm opened this issue Feb 2, 2023 · 2 comments
Assignees
Labels
Type: Bug Type: Enhancement Enhancements to features that already exist, but are not major additions
Milestone

Comments

@pd-cm
Copy link
Contributor

pd-cm commented Feb 2, 2023

Problem to Solve

As found in this thread: https://wordpress.org/support/topic/image-title-and-description/

And this Slack post: https://podswp.slack.com/archives/C02SVLHQF/p1675292247157559

{@post_thumbnail.post_content} and {@post_thumbnail.post_excerpt} both don't work

Proposed Solution

Adding the dot notation for thumbnails would be nice.

Possible Workaround

{@ID,get_the_post_thumbnail_caption} works. Hopefully {@relationship_field.ID,get_the_post_thumbnail_caption} also works.

Examples Elsewhere

No response

Screenshots / Screencast

No response

@pd-cm pd-cm added the Type: Enhancement Enhancements to features that already exist, but are not major additions label Feb 2, 2023
@picthall
Copy link

picthall commented Feb 2, 2023

Confirming that {@relationship_field.ID,get_the_post_thumbnail_caption} works for pulling the Caption.

@sc0ttkclark
Copy link
Member

sc0ttkclark commented Mar 6, 2023

Fixed via fb56c5c

This was originally supported but there was a bug causing it to not work as expected.

Also, check out what I added in 92241ac

Lots more options for dot notation!

As of Pods 2.9.12, these will all be supported:

  • Post thumbnail ID: {@post_thumbnail.ID} - Example: 1234
  • Post thumbnail title (new shorthand): {@post_thumbnail.title} - Example: This is the image title
  • Post thumbnail description (new shorthand): {@post_thumbnail.description} - Example: This is the description text
  • Post thumbnail caption (new shorthand): {@post_thumbnail.caption} - Example: This is the caption text
  • Post thumbnail alt_text (new shorthand): {@post_thumbnail.alt_text} - Example: This is the alt text
  • Post thumbnail extension (new): {@post_thumbnail.extension} - Example: jpg
  • Post thumbnail mime_type (new): {@post_thumbnail.mime_type} - Example: image/jpeg
  • Post thumbnail width (new): {@post_thumbnail.width} - Example: 100
  • Post thumbnail height (new): {@post_thumbnail.height} - Example: 200
  • Post thumbnail dimensions (new): {@post_thumbnail.dimensions} - Example: 100x200
  • Post thumbnail filesize (in bytes) (new): {@post_thumbnail.filesize} - Example: 12345
  • Post thumbnail image_meta.aperture (reference any image meta data) (new): {@post_thumbnail.image_meta.aperture} - Example: 0
  • Post thumbnail filename (new): {@post_thumbnail.filename} - Example: my-image.jpg
  • Post thumbnail post_type: {@post_thumbnail.post_type} - Example: attachment
  • Post thumbnail any other object fields: {@post_thumbnail.whatever_object_field_here}
  • Post thumbnail any other custom fields: {@post_thumbnail.whatever_meta_key_here}

@sc0ttkclark sc0ttkclark self-assigned this Mar 6, 2023
@sc0ttkclark sc0ttkclark added this to the Pods 2.9.12 milestone Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Type: Enhancement Enhancements to features that already exist, but are not major additions
Projects
Status: Done
Development

No branches or pull requests

3 participants