| 1 | <?php |
||
| 19 | class GravityView_Plugin_Hooks_Gravity_Perks extends GravityView_Plugin_and_Theme_Hooks { |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var string Check for the Gravity Perks class |
||
| 23 | */ |
||
| 24 | protected $class_name = 'GravityPerks'; |
||
| 25 | |||
| 26 | |||
| 27 | /** |
||
| 28 | * Filter the values shown in GravityView frontend |
||
| 29 | * |
||
| 30 | * @since 1.17 |
||
| 31 | */ |
||
| 32 | protected function add_hooks() { |
||
| 39 | |||
| 40 | |||
| 41 | /** |
||
| 42 | * Convert Unique ID fields to be Text fields in Edit Entry |
||
| 43 | * |
||
| 44 | * @since 1.17.4 |
||
| 45 | * |
||
| 46 | * @param GF_Field[] $fields Array of fields to be shown on the Edit Entry screen |
||
| 47 | * |
||
| 48 | * @return GF_Field[] Array of fields, with any hidden fields replaced with text fields |
||
| 49 | */ |
||
| 50 | public function edit_entry_fix_uid_fields( $fields ) { |
||
| 66 | |||
| 67 | } |
||
| 68 | |||
| 69 | new GravityView_Plugin_Hooks_Gravity_Perks; |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.