gravityview /
GravityView
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
|
0 ignored issues
–
show
|
|||
| 2 | /** |
||
| 3 | * Add WPML compatibility to GravityView, including registering scripts and styles to GravityView no-conflict list |
||
| 4 | * |
||
| 5 | * @file class-gravityview-theme-hooks-wpml.php |
||
| 6 | * @package GravityView |
||
| 7 | * @license GPL2+ |
||
| 8 | * @author Katz Web Services, Inc. |
||
| 9 | * @link http://gravityview.co |
||
| 10 | * @copyright Copyright 2015, Katz Web Services, Inc. |
||
| 11 | * |
||
| 12 | * @since 1.19.2 |
||
| 13 | */ |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @inheritDoc |
||
| 17 | */ |
||
| 18 | class GravityView_Theme_Hooks_WPML extends GravityView_Plugin_and_Theme_Hooks { |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @inheritDoc |
||
| 22 | * @since 1.19.2 |
||
| 23 | */ |
||
| 24 | protected $script_handles = array( |
||
| 25 | 'wpml-cpi-scripts', |
||
| 26 | 'sitepress-scripts', |
||
| 27 | 'sitepress-post-edit', |
||
| 28 | 'sitepress-post-list-quickedit', |
||
| 29 | 'sitepress-languages', |
||
| 30 | 'sitepress-troubleshooting', |
||
| 31 | ); |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @inheritDoc |
||
| 35 | * @since 1.19.2 |
||
| 36 | */ |
||
| 37 | protected $style_handles = array( |
||
| 38 | 'wpml-select-2', |
||
| 39 | 'wpml-tm-styles', |
||
| 40 | 'wpml-tm-queue', |
||
| 41 | 'wpml-dialog', |
||
| 42 | 'wpml-tm-editor-css', |
||
| 43 | ); |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @inheritDoc |
||
| 47 | * @since 1.19.2 |
||
| 48 | */ |
||
| 49 | protected $constant_name = 'ICL_SITEPRESS_VERSION'; |
||
| 50 | |||
| 51 | } |
||
| 52 | |||
| 53 | new GravityView_Theme_Hooks_WPML; |
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.