Automattic / Automattic/jetpack
Social Notes: include in RSS feed
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
### Impacted plugin
Social
### What
It would be nice if Social notes were automatically added to a site's RSS feed, alongside regular posts
### How
I believe we should be able to hook into `request` to make that happen.
https://developer.wordpress.org/reference/hooks/request/
This was requested here:
https://www.reddit.com/r/Wordpress/comments/1ipruo3/how_to_include_social_notes_in_rss_feed/
For now I've shared this workaround to implement it via a functionality plugin:
```php
/**
* Add posts from the Social Notes CPT (added via the Jetpack Social plugin) in main RSS feed.
*
* @param array $query_vars The array of requested query variables.
*
* @return array
*/
function jeherve_add_social_notes_rss( $query_vars ) {
if (
isset( $query_vars['feed'] )
&& ! isset( $query_vars['post_type'] )
) {
$query_vars['post_type'] = array( 'post', 'jetpack-social-note' );
}
return $query_vars;
}
add_filter( 'request', 'jeherve_add_social_notes_rss' );
```
Contributor guide
Research direction
Start with the Social plugin and the WordPress request hook referenced in the issue, then review how the main RSS feed selects post types. Use the provided functionality-plugin workaround as the behavioral reference. Done means Social Notes appear in the site's main RSS feed alongside regular posts without requiring that workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend, web-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100