-
Notifications
You must be signed in to change notification settings - Fork 61
v1.x Code Style
Beans 1.x is based upon PHP 5.2.
We are working to upgrade the codebase to be WordPress Coding Standard (WPCS) compliant. We follow the [WordPress Handbook](https://make.wordpress.org/core/handbook/best-practices/coding-standards/], except for noted below.
Follow WordPress' naming standards, meaning:
- lowercase letters
- underscores
render_view()
andrun()
The exposed functions, i.e. those the child theme and plugins will use, will be prefixed and not namespaced. Naming follows this convention:
beans_verb_description()
Functions do work, such as render, run, check, do, process, etc. Work means they are action-based, i.e. verbs.
The description tells you what the expected behavior is when you call this function. It's clear and expressive. Remember the intent: tells you the expected behavior.
The benefit to that naming convention is: you can read the function's name and know what will happen when you call it.
... coming
..... more to come.....