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

Compatibility issue between custom RSS feeds and Yoast SEO category prefix setting #21373

Closed
6 of 11 tasks
gsusI opened this issue May 8, 2024 · 3 comments · Fixed by #21374
Closed
6 of 11 tasks

Compatibility issue between custom RSS feeds and Yoast SEO category prefix setting #21373

gsusI opened this issue May 8, 2024 · 3 comments · Fixed by #21374
Assignees

Comments

@gsusI
Copy link

gsusI commented May 8, 2024

  • I've read and understood the contribution guidelines.
  • I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened

Custom RSS feeds added through the "add_feed" function experience a compatibility issue when the Yoast SEO plugin's setting for prefixing categories in slugs is disabled. With this setting disabled, the custom feeds fail to function as intended. However, if the Yoast SEO plugin is entirely disabled, the custom feeds operate correctly.

To Reproduce

Step-by-step reproduction instructions

  1. Add feed: add_feed('last_month', array($this, 'custom_rss_feed_callback_last_month'));
  2. Disable feature Show the categories prefix in the slug in wp-admin/admin.php?page=wpseo_page_settings#/taxonomy/categories
  3. Go to the feed URL: /category_name/feed/last_month, it throws an error

Expected results

  1. See the feed

Actual results

  1. An error

Screenshots, screen recording, code snippet

image

Technical info

  • If relevant, which editor is affected (or editors):
  • Block Editor
  • Gutenberg Editor
  • Elementor Editor
  • Classic Editor
  • Other:
  • Which browser is affected (or browsers):
  • Chrome
  • Firefox
  • Safari
  • Other:

Used versions

  • Device you are using: latest
  • Operating system:
  • PHP version: 8.3
  • WordPress version: latest
  • WordPress Theme: genesis
  • Yoast SEO version: latest
  • Gutenberg plugin version:
  • Elementor plugin version:
  • Classic Editor plugin version:
  • Relevant plugins in case of a bug:

Tasks

No tasks being tracked yet.
@gsusI
Copy link
Author

gsusI commented May 8, 2024

I've added a pull request. Please merge and release.

@josevarghese
Copy link
Contributor

Thanks, @gsusI, for using the Yoast SEO plugin and creating the issue to improve our plugin.

Our development team will review the PR you have submieed and will update you soon.

Thanks in advance :)

@gsusI
Copy link
Author

gsusI commented May 9, 2024

Sounds good!

They might want to check this reference: https://github.com/WordPress/WordPress/blob/00b440c27dab9b05fe2983eacd312a4b09b4b074/wp-includes/class-wp-rewrite.php#L874C3-L874C4. It shows how WordPress originally generates that section of the rewrite rules that Yoast is currently hardcoding.

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 a pull request may close this issue.

3 participants