This entry is part 3 of 9 in the Plugin Thoughts Series
- Plugin Thoughts Episode 1: Making Your Plugins More Extensible
- Plugin Thoughts Episode Two – Use Filters for Plugin Text
- Plugin Thoughts Episode 3 – Don’t Forget About Core Functions
- Plugin Thoughts Episode 4 – Learn How Core Does It
- Plugin Thoughts Episode 5 – Take Responsibility for Your Products
- Plugin Thoughts Episode 6 – Contribute to the WordPress Codex
- Plugin Thoughts Episode 7 – Remember Core CSS
- Plugin Thoughts Episode 8 – Create Clean Code
- Plugin Thoughts Episode 9 – Write Better Code; Release Better Plugins
When developing for WordPress, both in themes and plugins, do not forget that many, many core functions exist and that it is not always necessary (or wise) to write your own custom methods. Most core functions have actions and filters included, so when you write your own function to replace the one in core, these filters and actions are often excluded, which results in other developers not being able to use the filters and actions when also using your plugin or theme.
This episode is a direct result of my experience while working with a theme (mentioned in the video) that has a custom function for displaying featured post thumbnails. I was attempting to modify the HTML of the featured thumbnail, though the core post_thumbnail_html filter, but since the theme used its own custom function, which did not include this filter, my filter function was useless.