Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-05-12 06:50:22

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

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

Board footer

Powered by FluxBB