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

Error appeared when we used $feedname parameter (started with _ ) with add_feed() function #1616

Closed
narenin opened this issue Jun 22, 2024 · 2 comments
Labels
[Status] Done Issue is completed

Comments

@narenin
Copy link

narenin commented Jun 22, 2024

Core Trac: https://core.trac.wordpress.org/ticket/59945#comment:10

Issue Description

Error appeared when we used $feedname parameter (started with _ ) with add_feed() function. This is happening because the _ at the beginning of the feed name is removed in the do_feed function.

This process results in an action name of 'do_feed_' . 'feed2' when $feed is '_feed2'.

Since this is not done in the add_feed function and the action name specified in the add_action function is 'do_feed_' . '_feed2', since the two action names do not match, which resulting in the error indicated in the response.

URL of the Page with the Issue

https://developer.wordpress.org/reference/functions/add_feed/

Section of Page with the issue

We need to mention in the doc that $feedname parameter should not start with _

Why is this a problem?

This process results in an action name of 'do_feed_' . 'feed2' when $feed is 'feed2'. Since this is not done in the add_feed function and the action name specified in the add_action function is 'do_feed' . '_feed2', since the two action names do not match, which resulting in the error indicated in the response.

Suggested Fix

We should mention in the doc that $feedname parameter should not start with _

@narenin narenin added the [Status] To do Issue marked as Todo label Jun 22, 2024
Copy link

Heads up @WordPress/docs-issues-coordinators, we have a new issue open. Time to use 'em labels.

@atachibana
Copy link
Collaborator

@narenin

Below sentence was inserted to More Information section of add_feed() reference, because it can be reflected without code changes.

$feedname parameter should not start with ‘_‘. Please refer #59945.

@github-actions github-actions bot added [Status] Done Issue is completed and removed [Status] To do Issue marked as Todo labels Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Done Issue is completed
2 participants