lightspeeddevelopment /
lsx-customizer
| 1 | <?php |
||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
| 2 | if ( ! class_exists( 'LSX_Customizer_Core' ) ) { |
||
|
0 ignored issues
–
show
|
|||
| 3 | |||
| 4 | /** |
||
| 5 | * LSX Customizer Core Class |
||
| 6 | * |
||
| 7 | * @package LSX Customizer |
||
| 8 | * @author LightSpeed |
||
| 9 | * @license GPL3 |
||
| 10 | * @link |
||
| 11 | * @copyright 2016 LightSpeed |
||
| 12 | */ |
||
| 13 | class LSX_Customizer_Core extends LSX_Customizer { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Constructor. |
||
| 17 | * |
||
| 18 | * @since 1.0.0 |
||
| 19 | */ |
||
| 20 | public function __construct() { |
||
|
0 ignored issues
–
show
|
|||
| 21 | add_action( 'customize_register', array( $this, 'customize_register' ), 20 ); |
||
| 22 | } |
||
|
0 ignored issues
–
show
|
|||
| 23 | |||
| 24 | /** |
||
| 25 | * Customizer Controls and Settings. |
||
| 26 | * |
||
| 27 | * @param WP_Customize_Manager $wp_customize Theme Customizer object. |
||
| 28 | * @since 1.0.0 |
||
| 29 | */ |
||
| 30 | public function customize_register( $wp_customize ) { |
||
| 31 | /** |
||
| 32 | * Core section: Theme Credit |
||
| 33 | */ |
||
| 34 | $wp_customize->add_setting( 'lsx_theme_credit_status', array( |
||
|
0 ignored issues
–
show
|
|||
| 35 | 'default' => true, |
||
| 36 | 'sanitize_callback' => array( $this, 'sanitize_checkbox' ), |
||
| 37 | ) ); |
||
|
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
Loading history...
|
|||
| 38 | |||
| 39 | $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_theme_credit_status', array( |
||
|
0 ignored issues
–
show
|
|||
| 40 | 'label' => esc_html__( 'Theme Credit', 'lsx-customizer' ), |
||
|
0 ignored issues
–
show
|
|||
| 41 | // 'description' => esc_html__( 'Displays theme credit in footer.', 'lsx-customizer' ), |
||
|
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
58% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. Loading history...
|
|||
| 42 | 'section' => 'lsx-layout', |
||
|
0 ignored issues
–
show
|
|||
| 43 | 'settings' => 'lsx_theme_credit_status', |
||
|
0 ignored issues
–
show
|
|||
| 44 | 'type' => 'checkbox', |
||
|
0 ignored issues
–
show
|
|||
| 45 | 'priority' => 10, |
||
|
0 ignored issues
–
show
|
|||
| 46 | ) ) ); |
||
|
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
Loading history...
|
|||
| 47 | } |
||
|
0 ignored issues
–
show
|
|||
| 48 | |||
| 49 | } |
||
| 50 | |||
| 51 | new LSX_Customizer_Core(); |
||
| 52 | |||
|
0 ignored issues
–
show
|
|||
| 53 | } |
||
| 54 |