Textpattern CMS support forum
Naming conventions for plugins
This has now been superseded – please see here for correct information.
As plugins share a common global environment with each other and the core Textpattern code, all names introduced by one particular plugin introduce a risk to collide with others in the same domain.
To avoid these risks, please stick to the following guidelines:
- Choose a three letter prefix to separate your names from the rest of the ‘Textpattern universe’. An overview of taken prefixes is collected at Textpattern CMS User Documentation. Add yourself to the list (requires a registered Wiki account) or have someone else do it for you.
- Add this prefix to all globally visible entities, as is…
- names of PHP classes, functions and global variables in the plugin’s code.
- database table and indices names.
- names of stored preferences in the
txp_prefstable and/or the
- ids and classes of HTML elements you add to the backend interface.
- anything else I haven’t thought of yet. ;-)
Last edited by philwareham (2015-09-14 15:54:51)