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

List of arguments is empty when apply_filters is returned instead of assigned to variable #11

Closed
LuigiPulcini opened this issue Jan 25, 2022 · 1 comment

Comments

@LuigiPulcini
Copy link

There seems to be a difference in the output between the two following occurrences:

<?php
/**
 * My plugin filter assigned to a variable
 *
 * @param string $first_param This is the first argument
 * @param string $second_param This is the second argument
 */
$some_variable = apply_filters( 'my_plugin_filter', $first_param, $second_param );

return $some_variable;
<?php
/**
 * My plugin filter directly returned
 *
 * @param string $first_param This is the first argument
 * @param string $second_param This is the second argument
 */
return apply_filters( 'my_plugin_filter', $first_param, $second_param );

In the first case, the full list of arguments is correctly parsed. In the second case, the list of arguments is empty.

@LuigiPulcini LuigiPulcini changed the title List of @param disregarded when apply_filters is returned instead of assigned to variable List of arguments is empty when apply_filters is returned instead of assigned to variable Jan 25, 2022
remcotolsma added a commit that referenced this issue Jan 27, 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

No branches or pull requests

2 participants