-
Notifications
You must be signed in to change notification settings - Fork 179
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
Disable feeds on custom post type archive #12844
Conversation
Plugin builds for afb8724 are ready 🛎️!
|
Size Change: 0 B Total Size: 2.71 MB ℹ️ View Unchanged
|
includes/Discovery.php
Outdated
if ( is_post_type_archive( $this->story_post_type->get_slug() ) ) { | ||
remove_action( 'wp_head', 'feed_links_extra', 3 ); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this extra method we can just do if ( is_post_type_archive( $this->story_post_type->get_slug() ) ) { return; }
in print_feed_link()
below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like that solution personally 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? To me it seems easier to just not do something (i.e. print a feed link) when we know that WP already handles it, instead of unhooking feed_links_extra
and then having to adjust this code again when bumping version requirements. That's why I mentioned that approach on the ticket.
Context
Summary
Remove the action
feed_links_extra
on custom post type archives for web stories. This stop a double print out of rss feed.Relevant Technical Choices
To-do
User-facing changes
Before
After
Testing Instructions
This PR can be tested by following these steps:
/web-stories
./web-stories/feed/
in the head. See screenshot for examples.Testing, it would be helpful to look at other url types, like single, page, category etc and check the feedback links.
This change will NOT be affected by browser. Validate in chrome and should work everywhere.
Reviews
Does this PR have a security-related impact?
Does this PR change what data or activity we track or use?
Does this PR have a legal-related impact?
Checklist
Type: XYZ
label to the PRFixes #12725