Making WordPress.org

Opened 9 months ago

Closed 8 months ago

Last modified 8 months ago

#7341 closed enhancement (fixed)

Image enclosures for the photo directory feed

Reported by: cagrimmett's profile cagrimmett Owned by: coffee2code's profile coffee2code
Milestone: Priority: normal
Component: Photo Directory Keywords:
Cc:

Description

The Photo Directory feed (https://wordpress.org/photos/feed/) is primarily for photos, so it makes sense to include an <enclosure> element for the images as a sub-element of <item>. It is kind of like a podcast but for photos.

More details on the enclosure element: https://cyber.harvard.edu/rss/rss.html#ltenclosuregtSubelementOfLtitemgt

It should include the url, length in bytes, and MIME type.

This was suggested by [Dave Winer](http://scripting.com/), author of the RSS 2.0 spec.

Change History (5)

This ticket was mentioned in Slack in #meta by courtneyengle. View the logs.


9 months ago

#2 @coffee2code
9 months ago

Seems reasonable. A lot of documentation for the tag are quite old. It seems adding the enclosure tag is all that is needed, as the existing output benefits users from an accessibility point of view. My only concern is if feed readers will duplicate the image when being viewed.

Existing feed entry:

<item>
	<title>5946554960</title>
	<link>https://wordpress.org/photos/photo/5946554960/</link>
		
	<dc:creator><![CDATA[sharankrishna]]></dc:creator>
	<pubDate>Wed, 15 Nov 2023 14:08:54 +0000</pubDate>
	<guid isPermaLink="false">https://wordpress.org/photos/?post_type=photo&#038;p=43801</guid>

	<description><![CDATA[village canal scenery.]]></description>
	<content:encoded>
	<![CDATA[
		<figure><img width="768" height="576" src="https://pd.w.org/2023/11/59465549604eec406.04183112-768x576.jpg" class=" wp-post-image" alt="" style="margin-bottom: 10px;" decoding="async" />
			<figcaption><p>village canal scenery.</p></figcaption>
		</figure>
	]]></content:encoded>
</item>

Modified feed entry to include enclosure (which is the only change):

<item>
	<title>5946554960</title>
	<link>https://wordpress.org/photos/photo/5946554960/</link>
		
	<dc:creator><![CDATA[sharankrishna]]></dc:creator>
	<pubDate>Wed, 15 Nov 2023 14:08:54 +0000</pubDate>
	<guid isPermaLink="false">https://wordpress.org/photos/?post_type=photo&#038;p=43801</guid>

	<description><![CDATA[village canal scenery.]]></description>
	<content:encoded>
	<![CDATA[
		<figure><img width="768" height="576" src="https://pd.w.org/2023/11/59465549604eec406.04183112-768x576.jpg" class=" wp-post-image" alt="" style="margin-bottom: 10px;" decoding="async" />
			<figcaption><p>village canal scenery.</p></figcaption>
		</figure>
	]]></content:encoded>
	<enclosure url="https://pd.w.org/2023/11/59465549604eec406.04183112-768x576.jpg" length="94583" type="image/jpeg" />
</item>

#3 @Otto42
8 months ago

+1 Good idea.

#4 @coffee2code
8 months ago

  • Owner set to coffee2code
  • Resolution set to fixed
  • Status changed from new to closed

In 12987:

Photo Directory, Posts: Add image enclosures for the photo directory feed.

Also adds constant for image size to use in photo feeds.

Props cagrimmett, coffee2code.
Fixes #7341.

#5 @cagrimmett
8 months ago

Looks great! Thank you, @coffee2code!

Note: See TracTickets for help on using tickets.