Skip to content

Social Notes: include in RSS feed #42293

@jeherve

Description

@jeherve

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:

/**
 * 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' );

Metadata

Metadata

Assignees

No one assigned

    Labels

    Customer Report [LEGACY]Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report"EnhancementChanges to an existing feature — removing, adding, or changing parts of it[Experiment] AI labels added[Feature Group] Content ManagementFeatures related to the tools and screens that admins use to manage their sites core content.[Feature] Social Notes[Plugin] SocialIssues about the Jetpack Social plugin[Pri] Low

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions