Fixed a couple of function descriptions in wp-includes/plugin.php
|Reported by:||amereservant||Owned by:||westi|
|Component:||Inline Docs||Keywords:||has-patch commit|
There were a couple of errors I found in the function docblocks while tinkering in the plugins.php file as well as a confusing example, so here's what I fixed:
It mentioned filters were for modifying "strings", which isn't correct since you can also use filters to modify arrays, etc., so I changed the docblock to reflect this.
I also changed the example code to var_dump($example); instead of echo $example; since echoing arrays/objects etc. will cause an error.
The example code block was confusing since it specified a filter function, but didn't show it being added and then just called apply_filters(), which I didn't notice the relation at first.
I added the add_filter() function in the code example for a clearer example so the reader will better understand the usage of this function.
A mysterious $hook parameter was defined in the docblock, however the parameter simply doesn't exist. Not sure if this was a passing thought or someone falling asleep while writing it, but I've removed it from the docblock.
Change History (19)
- Type changed from defect (bug) to enhancement
- Version changed from 3.3 to 1.5