This repository has been archived by the owner on Sep 2, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think this filter name should have a prefix, to avoid clashes with other plugins which might have the exact same hook name.
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.
In my opinon
mlp_linked_elements_html
would better fit the existing filters.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.
That's exactly what it will be. 👍
We don't name filter hooks just like the function/method they live in, but choose more sensible names.
show_linked_elements
(prefixed or not) may be misinterpreted as some sort of boolean switch for some functionality.So
mlp_linked_elements_html
it is.Also, for the sake of easier debugging, the result of the filter should be cached in the
$output
variable, which is returned the line after that. This way, one can step through the code, and easily see the original output and the filtered one.Lastly, the filter is lacking appropriate documentation. Please see this one as an example.
@DasLlama would you like to take care of that, or do you just want this included? :)