Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Topic closed
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_prefs
table and/or the$prefs
array. - any global JavaScript variables or function names you use for either modifying the backend or adding features to the frontend.
- 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)
Offline
Pages: 1
Topic closed