Who owns the function? [from Plugins development series]
Once again, I find useful to recommend remind one important
practice, when writing a plugin.
Be sure, that user will notice, he's using functions of your plugin.
Life example: In the first project, user did use the get_meta
function and expected, it's a core function. It didn't do anything specific.
Why should he ever expect, it's part of a plugin? But once he tried to use this
function elsewhere, it surprisingly failed, function wasn't found. The (in other
ways great) plugin called More fields was
missing.
Two ways how to emphasize function's owner:
- prefix function-name with your unique signature (will also
lower the risk of name-collision):
get_meta⇒mf_get_meta - use a bundling class:
get_meta⇒MoreFields::get_meta
Comments
No comments yet.
Add a comment