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

DocBlock for hooks not parsed correctly in some cases #217

Open
pbiron opened this issue Jul 2, 2019 · 0 comments
Open

DocBlock for hooks not parsed correctly in some cases #217

pbiron opened this issue Jul 2, 2019 · 0 comments

Comments

@pbiron
Copy link

pbiron commented Jul 2, 2019

While parsing the source for a plugin, I came across a case where the DocBlock for a hook isn't parsed correctly.

The code contains the following:

/**
 * Filters the filename to be required.
 *
 * @since 1.2.3
 *
 * @param string $filename The filename to require.
 */
require apply_filters( 'my-filter', 'some filename' );

The hook gets imported (including the description), but for some reason the @since tag is not. Instead, @since tags from the file-level DocBlock are associated with the hook.

Changing the code to the equivalent:

/**
 * Filters the filename to be required.
 *
 * @since 1.2.3
 *
 * @param string $filename The filename to require.
 */
$filename = apply_filters( 'my-filter', 'some filename' );
require $filename;

works just fine.

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

1 participant