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

Feed item filter #144

Merged
merged 5 commits into from
Feb 15, 2022
Merged

Feed item filter #144

merged 5 commits into from
Feb 15, 2022

Conversation

cadic
Copy link
Contributor

@cadic cadic commented Feb 9, 2022

Description of the Change

With this PR we introduce new filter simple_podcasting_feed_item to allow modification of each feed item before output to RSS2.

To be able to filter, tenup_podcasting\feed_item() is rerfactored:

  • all data is saved into an array
  • array is passed through the filter
  • output is made as single portion of code

Closes #17

Alternate Designs

n/a

Possible Drawbacks

not discovered

Verification Process

  1. Create new Podcast
  2. Add new post with Podcast Block and connect it with the Podcast
  3. Add filter to simple_podcasting_feed_item (example below)
  4. Check Podcast RSS — expected to match filter modifications

Example of filter:

function podcasting_feed_item_filter( $feed_item = array(), $post_id = null, $term_id = null ) {
	$feed_item['keywords'] = 'one,two,three';
	return $feed_item;
}
add_filter( 'simple_podcasting_feed_item', 'podcasting_feed_item_filter', 10, 3 );

Should result in keywords added to each feed item:

<itunes:keywords>one,two,three</itunes:keywords>

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Added - Filter 'simple_podcasting_feed_item' to modify RSS feed item data before output

Credits

Props @cadic

@cadic cadic added this to the 1.3.0 milestone Feb 9, 2022
@cadic cadic self-assigned this Feb 9, 2022
@cadic
Copy link
Contributor Author

cadic commented Feb 9, 2022

Blocked by #145
Cypress test fails on WordPress 5.9

@cadic cadic requested review from a team, iamdharmesh and jeffpaul and removed request for a team February 10, 2022 10:06
@cadic cadic changed the title Feature/feed item filter Feed item filter Feb 10, 2022
@cadic cadic marked this pull request as ready for review February 10, 2022 10:07
Copy link
Member

@iamdharmesh iamdharmesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for great work @cadic !! LGTM 👍
I am able to verify test steps mentioned in PR description.

@jeffpaul jeffpaul removed their request for review February 14, 2022 18:38
@jeffpaul jeffpaul merged commit d41cfcb into develop Feb 15, 2022
@jeffpaul jeffpaul deleted the feature/feed-item-filter branch February 15, 2022 22:41
@cadic cadic modified the milestones: 1.3.0, 1.2.2 Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add filters for feed item output
3 participants