Coding Standarts

Module names

Module name should be lovercase without "_" symbols

Incorrect name Correct name
OpacitySliderField opacitysliderfield
color_picker colorpicker

Class names

Last wordpress is supported PHP 5.2.4 Do not use namespaces because they unsupported in PHP 5.2

  • All classes shold start with Prefix + Name.
  • Use CamelCase for name with Upercase first letter.
  • Filename should be the same as the ClassName+".class.php"
Prefixes Module
Smart for core modules or non module classes
SmartComponent for component modules
SmartAnimation for animation modules
SmartField for form fields modules

Examples

//file row/include/SmartComponentRow.class.php
class SmartComponentRow extends SmartComponent {

}

SmartField names

All SmartField classes must consist of SmartField+FieldType in camel case

Incorrect name Correct name
OpacitySliderField SmartFieldSlider
colorPicker SmartFieldColor
imagePicker SmartFieldImage